Also das Paket Konsolekit habe ich installiert:
aber leider, du ahnst es schon :
corpsman@corpsman2:~/Desktop/Shutdown$ ./project1
[WARNING] Out of OEM specific VK codes, changing to unassigned
[WARNING] Out of unassigned VK codes, assigning $FF
Shutting down Linux...
WARNING: TLCLComponent.Destroy with LCLRefCount>0. Hint: Maybe the component is processing an event?
process 5404: arguments to dbus_message_set_destination() were incorrect, assertion "destination == NULL || _dbus_check_is_valid_bus_name (destination)" failed in file dbus-message.c line 2891.
This is normally a bug in some application using the D-Bus library.
Not enough memory
corpsman@corpsman2:~/Desktop/Shutdown$
Und dann passiert nichts mehr, sprich das System fährt nicht herunter
[Edit]
Generell scheint das Process ding aber zu gehen, denn wenn ich stattdessen schreibe :
Code: Alles auswählen
procedure ShutdownLinux;
var p: TProcess;
begin
if FileExists('/usr/bin/dbus-send') then
begin
p:=TProcess.Create(nil);
p.Options:=[];
writeLn('Shutting down Linux...');
p.CommandLine:= 'gwenview';
//'dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop';
p.Execute;
p.Free;
halt(0);
end else writeLn('DBus command line utility not found!');
end;
dann öffnet sich gwenview...
[Edit2]
Der Befehl scheint aber zu gehen, denn wenn ich
dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop
in einer Konsole eingebe ist der Rechner schneller aus, als das ich noch irgendwas klicken kann ...
Gibts da evtl noch nen anderen Modus das der Process den Befehl Ausführt ?