SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I installed thermald I know I need/should write a script called rc.thermald then add it to rc.local in /etc/rc.d and per-instructions from slackbuilds
Code:
Since this is a daemon, it can be started at boot via /etc/rc.d/rc.local:
/usr/sbin/thermald
It might be necessary to create /var/run/thermald/ first (depending on your local system setup)
An entry could be added to /etc/rc.d/rc.local_shutdown as well:
killall thermald
CONFIG_X86_MSR is listed as an (optional) dependency, msr-tools
can be installed from http://01.org/msr-tools via src2pkg (www.src2pkg.net/)
If you installed a previous version of thermald, you may need to uninstall
it and then install this one instead of using upgradepkg.
add a shut down in /etc/rc.d/rc.local_shutdown just adding that line killall thermald???
but I am not even sure what format/syntax to use having cat a few of the rc.xxx files to try and get an idea. it confused me instead. In Void Linux all I got a do is just add a soft link from /etc/sv/daemonName to /var/service and that is it, next reboot it starts, or issue #sv u daemon name and start it right then as well. done deal.
Well, normally someone would write an /etc/rc.d/rc.thermald script that has "start" and "stop" options. Sometimes there will be "restart" and/or "status" methods.
The "restart" method will normally just call the start and stop functions. Any "status" method will look for a pid file and see if that pid matches a running version of the service.
Here's an example (/etc/rc.d/rc.messagebus)...
Code:
#!/bin/sh
#
# messagebus: The D-BUS systemwide message bus
#
# description: This is a daemon which broadcasts notifications of system events \
# and other messages. See http://www.freedesktop.org/software/dbus/
#
# processname: dbus-daemon
# This is a modified version of the rc.messagebus script distributed with the
# dbus sources. Thanks to Don Tanner of the GWare <http://gware.org> Project
# for most of the work involved --Robby Workman <rworkman@slackware.com>
PIDFILE=/var/run/dbus/dbus.pid
start() {
mkdir -p $(dirname $PIDFILE)
if ! ps -u messagebus -c | grep -wq dbus-daemon; then
rm -f $(dirname $PIDFILE)/*
if [ -x /usr/bin/dbus-uuidgen -a -x /usr/bin/dbus-daemon ] ; then
echo "Starting system message bus: /usr/bin/dbus-uuidgen --ensure ; /usr/bin/dbus-daemon --system"
/usr/bin/dbus-uuidgen --ensure
/usr/bin/dbus-daemon --system 1> /dev/null
fi
fi
}
stop() {
if [ -e "$PIDFILE" ]; then
echo "Stopping system message bus..."
pid=$(cat $PIDFILE)
kill $pid 1> /dev/null 2> /dev/null
# Just in case:
killall dbus-daemon 1> /dev/null 2> /dev/null
rm -f $PIDFILE
fi
}
reload() {
echo "Reloading system message bus configuration..."
if [ -e "$PIDFILE" ]; then
pid=$(cat $PIDFILE)
kill -HUP $pid
else
killall -HUP dbus-daemon
fi
}
status() {
if ps -u messagebus -c | grep -wq dbus-daemon; then
echo "System dbus-daemon is running."
else
echo "System dbus-daemon is stopped."
fi
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
echo "You may need to restart your Window Manager to reconnect to the system dbus."
;;
reload)
reload
;;
status)
status
;;
*)
echo $"Usage: $0 {start|stop|restart|reload|status}"
;;
esac
I haven't installed thermald before, but I think you should just do what it says.
Adding /usr/sbin/thermald in rc.local starts the program.
Its like starting a program on the command line.
Adding killall thermald kills the program at shutdown.
Like on the command line, killall thermald would quit the program.
Overthinking it, maybe?
yeah perhaps I am over thinking it out of not actually knowing the the simplicity of it. looking at all of the other scripts with case statements and if statements and such to check for everything well, conformity is a word that comes to mind. Seeing how thermald is a no hassle daemon. I got it installed on my other OS, Void and when I am pushing my CPU it works rather nicely.
thanks I think I'll try the simplistic approach first and see what happens.
Personally, I would drop the rc.thermald. To me, the rc.program files are beneficial when the startup of the program is a bit more complex, or you might want to turn it on or off. Granted, whether to create an rc.program file or just add a line or few into your rc.local is a personal preference, but based on the simplicity of this program, I'd just add the /usr/sbin/thermald line into your rc.local and be done with it. I don't think you need to worry about checking if it's executable unless you intend to manually change the permissions of the file itself. And unless this program might have issues if shutdown improperly, I don't think you need to worry about an entry in rc.local_shutdown (which doesn't exist until you create it).
Personally, I would drop the rc.thermald. To me, the rc.program files are beneficial when the startup of the program is a bit more complex, or you might want to turn it on or off. Granted, whether to create an rc.program file or just add a line or few into your rc.local is a personal preference, but based on the simplicity of this program, I'd just add the /usr/sbin/thermald line into your rc.local and be done with it. I don't think you need to worry about checking if it's executable unless you intend to manually change the permissions of the file itself. And unless this program might have issues if shutdown improperly, I don't think you need to worry about an entry in rc.local_shutdown (which doesn't exist until you create it).
KISS approach
already done, I deleted my rc.thermald file I created, added to rc.local all except I didn't add the absolute path to thermald and reboot to see if that worked, I just started off the command line in root login. using the word thermald so my brain said brain, just thermald should work it did in the terminal, and i created an rc.local_shutdown and chmod 'ed it. it maybe over kill but that shouldn't hurt anything.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.