David Zeuthen wrote:
I'm not sure that tricks like runlevel 4 is the way to go. For the FC5
timeframe we'll probably integrate something like this project
http://gnome-power.sourceforge.net/
which is under development. But there's some work left to get it right
for the system-wide case.
sounds good :-)
1;
could it manage services like pcmcia, isdn, networking, vncserver, gpm,
httpd, mysql, ntop, webmin, usermin, ... ?
would it work if i boot in runlevel 3 ?
2;
why not 2 possibilites for running on battery / mobile users / outdoor
work / ...
runlevel 4 = kill / do_not_start unnecessary services
gnome-power-manager = application control under X11
3;
imho runlevel 4 could be a good choice .
full multiuser, tty < run on battery, tty|X11 < full multiuser, X11
3 < 4 (switch 3->4 no X11, 5->4 X11 ) < 5
$ man runlevel
-- find the current and previous system runlevel
$ /sbin/runlevel
5 4
$ /sbin/runlevel
3 4
eg. apcupsd send an email if the UPS goes on batteries or the main is back.
i guess that modifications could be simple.
send an email, sleep a short time, switch to runlevel 4
--------
$ cat /etc/apcupsd/onbattery /etc/apcupsd/mainsback
#!/bin/sh
#
# This shell script if placed in /etc/apcupsd
# will be called by /etc/apcupsd/apccontrol when the UPS
# goes on batteries.
# We send an email message to root to notify him.
#
SYSADMIN=root
APCUPSD_MAIL="/bin/mail"
HOSTNAME=`hostname`
MSG="$HOSTNAME Power Failure !!!"
#
(
echo "Subject: $MSG"
echo " "
echo "$MSG"
echo " "
/sbin/apcaccess status
) | $APCUPSD_MAIL -s "$MSG" $SYSADMIN
exit 0
#!/bin/sh
#
# This shell script if placed in /etc/apcupsd
# will be called by /etc/apcupsd/apccontrol when the
# UPS goes back on to the mains after a power failure.
# We send an email message to root to notify him.
#
SYSADMIN=root
APCUPSD_MAIL="/bin/mail"
HOSTNAME=`hostname`
MSG="$HOSTNAME Power has returned"
#
(
echo "Subject: $MSG"
echo " "
echo "$MSG"
echo " "
/sbin/apcaccess status
) | $APCUPSD_MAIL -s "$MSG" $SYSADMIN
exit 0
----/----
--
shrek-m