Re: Rebooting the System



On Tue, 2006-04-11 at 21:27 -0700, Sandeep KS wrote:
Hello everyone,
        I am doing a project using GTK which needs rebooting of the system. 
When the code is executed, the user is asked to select some details. After he enters all the details and 
clicks on the  OK button, i need to save all the details and reboot the system. After rebooting, i need to 
execute the code again automatically with the next page of the code displayed. I also need to show all the 
saved details.
Is it possible to achieve this? How can i do it?

Do you want the code to be run as root, when the system boots, or
as the user after the user logs in?  If you want it run as root
(or Administrator on Windows NT, for example), it all depends on
the operating system.

On Solaris, for example, or HP-UX, or some distributions of Linux,
you might install a start-up system service; under FreeBSD you
might have a script in /usr/local/etc/init.d (I think)...

This script would probably run late in the boot process, and
check for a small file in ~root owned by root and having
file mode 600, and in a directory not generally writeable and
not a symbolic link -- if these things are not obviously
necessary, you need to find someone to go through why they
are all important for security reasons.  The file, if present,
would tell the system service (a shell script you have written)
that it must run the commands and remove the file.

None of this is related to Gtk+ though.

You can reboot with the "reboot" command, or with "telinit",
or with "uadmin", or with shutdown, depending on the operating
system.  Or some systems have other commands.  Presumably you
will allow the user to supply a reason for the logs and the
console messages, and also a time for a scheduled reboot.

On a well-configured system most users can't reboot without
at least entering a password somewhere; you may find console-helper
to be useful to avoid having to let the user enter a password
directly.  Root password should not be prompted for in a
gtk-engine-themed window, of course...  Again, this is
probably not the right list for these questions, since
rebooting a computer isn't really part of Gtk... but I
don't want to say "go away" and not give any guidelines :-)

Liam

-- 
Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/
Ankh: irc.sorcery.net irc.gnome.org www.advogato.org




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]