TPB (Thinkpad OSD Daemon) only works in runlevel 3
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.
TPB (Thinkpad OSD Daemon) only works in runlevel 3
I run a ThinkPad T43, which has some media buttons and other hotkeys (brightness up/down, ThinkLight, etc), so it's nice to have a utility to monitor the status of the various buttons, especially because the computer's so old that they are for hardware so XFCE's built in OSD won't detect anything. Because of this, I use TPB, a program that works in every distro I've tried, and in Slackware-- but only when you make your default runlevel 3. I do all of my work in X, so when I make runlevel 4 the default (to show a display manager on startup) it doesn't work, and instead gives me a
Code:
Unable to initialize xosd. Running without onsceen [sic] display.
error. I'm running the newest xosd and newest tpb versions, and everything works fine in runlevel 3.
How did you build that tpb package? When I had a T43 and used tpb, I needed to add a udev rule to fix the access permissions of the /dev/nvram file.
Note that in Slackware's runlevel 3 your user account is dynamically added to several groups that allow you to manage your hardware (after all, logging in to the console means you are _at_ your computer). Users who login at runlevel 4 are possibly remote users, and are by default not added to groups like floppy, audio, cdrom, video, scanner, power, plugdev etc... you will have to add your user account to these groups explicitly.
How did you build that tpb package? When I had a T43 and used tpb, I needed to add a udev rule to fix the access permissions of the /dev/nvram file.
Note that in Slackware's runlevel 3 your user account is dynamically added to several groups that allow you to manage your hardware (after all, logging in to the console means you are _at_ your computer). Users who login at runlevel 4 are possibly remote users, and are by default not added to groups like floppy, audio, cdrom, video, scanner, power, plugdev etc... you will have to add your user account to these groups explicitly.
I just used the "./configure && make && sudo make install" instructions on the website. I get this error even when I run tpb as root, so /dev/nvram permissions shouldn't matter, and neither should group permissions.
You can try my old SlackBuild script here: http://www.slackware.com/~alien/slackbuilds/tpb/build/
I just noticed that even in 2008 I already prepared my SlackBuild scripts for x86_64 ... amazing. I never used BlueWhite64 or Slamd64 myself.
NOTE: This not really work, please skip to next post
Hello,
I happen to have a ThinkPad X41 with Slackware-14.1 (32bit), which is technically close to T43, so decided to try out Alien's slackbuild of tpb. I had to install xosd dependency from slackbuilds.org first. Then SlackBuild worked and I've got the package.
It seems, that udev rule for nvram is outdated, because it shown errors. I do not know how to write these rules, so I've just removed it (rm /etc/udev/rules.d/01-nvram.rules).
Anyway, if you run tpb -d as root (in terminal), osd works! There for I've wrote rc.tpb file:
Code:
#!/bin/sh
start() {
echo "Starting ThinkPad buttons daemon: /usr/bin/tpb -d"
if [ ! -e /var/run/tpb.pid ]; then
/usr/bin/tpb -d
pidof tpb > /var/run/tpb.pid
else
echo "ThinkPad buttons daemon already running!"
fi
}
stop() {
echo "Stopping ThinkPad buttons daemon."
if [ -e /var/run/tpb.pid ]; then
kill $(cat /var/run/tpb.pid)
rm -f /var/run/tpb.pid
else
echo "ThinkPad buttons daemon is not running."
fi
}
restart() {
stop
sleep 1
start
}
status() {
if [ -e /var/run/tpb.pid ]; then
echo "ThinkPad buttons daemon is running."
else
echo "ThinkPad buttons daemon is stopped."
exit 1;
fi
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
status)
status
;;
*)
echo "Usage: {start|stop|restart|status}"
exit 1
;;
esac
Just place it in /etc/rc.d and then add these lines in /etc/rc.d/rc.local:
Code:
if [ -x /etc/rc.d/rc.tpb ]; then
/etc/rc.d/rc.tpb start
fi
If you give x permission (chmod +x /etc/rc.d/rc.tpb) it will start tpb daemon on system boot.
There is even configuration file /etc/tpbrc. Nice!
Hope this helps
Last edited by Totoro-kun; 07-21-2015 at 02:19 PM.
Sorry, the above does not really work, since tpb has to be started while X is running. However, after some research I was able to make it work. Here are the steps:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.