[Project_owners] Shutdown Mac/Linux OS

Didier Ernotte didier at ernotte.com
Fri Nov 23 12:07:11 PST 2007


In Mac OSX (which is a Unix system), and Linux, there is a command named "shutdown" or "shutdown now" most likely in "/sbin" to shutdown the system. I'm pretty sure that you must be logged as "root" (super user) to execute it. I don't know how you can grant your extension to have root privilege to execute the shutdown. You can always create a script that call the shutdown command, and give root privilege to whoever runs the script, but that a big hole in the security of the system.

Didier

InBasic <inb.cor at gmail.com> wrote: hi

As i don't have so much experience using Linux or Mac OS please help me to find out shutdown commands in these two OSs

In windows platform there are too many ways to turn off/standby/hibernate System,
 
In my extension (Auto Shutdown - InBasic) i use :

                var process = Components.classes["@ mozilla.org/process/util;1"]
                                        .createInstance(Components.interfaces.nsIProcess);
                process.init(DLL or ExE Path);
                process.run (false, args, args.length);    

to send shutdown command as args to "Command Prompt" or windows API (shell32.dll  or  PowrProf.dll ,  ... ),

if any body know similar way for shutdown/Hibernate/Standby Mac or Linux Please reply, 


Any help will be appreciated, 
InBasic



 _______________________________________________
Project_owners mailing list
Project_owners at mozdev.org
https://www.mozdev.org/mailman/listinfo/project_owners

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.mozdev.org/pipermail/project_owners/attachments/20071123/40fbf173/attachment.html 


More information about the Project_owners mailing list