6

I want to use tint2 as my panel in an Openbox session.

The tint2 configuration file is ~/.config/tint2/tint2rc. The tint2 configuration instructions have this:

When you change the config file, the command line 'killall -SIGUSR1 tint2' will force tint2 to reload it.

What does

killall -SIGUSR1

do?

In other words, how does running killall -SIGUSR1 tint2 cause tint2rc to be reloaded?


Edit: it appears that ~/.conkyrc can be reloaded the same way. From man conky:

An easy way to force Conky to reload your ~/.conkyrc: "killall -SIGUSR1 conky". Saves you the trouble of having to kill and then restart. You can now also do the same with SIGHUP.

1 Answers1

4

The kill command really send a signal to the process... it's a bit misnamed.

The command

killall -SIGxxx name

will send the "signal" xxx to the process with name "name". Process in Unix can receive and handle a set of signals to respond to external events. By default kill send the signal SIGTERM that has the (predefined) effect of gracefully kill the process. (the SIGKILL signal will kill the process "brutally", this is the reason that sometime you need to use the killall -SIGKILL ... command).

Some process have hardcoded meaning (for example: HUP is desconnection, etc. ) and are sometime sent by the kernel. USR1 and USR2 are user-definable signals.

You can even do that in scripts easily: if you put in a script the line

trap "echo TRAPPED" USR1

the script will print "TRAPPED" when you send the signal USR1 to it with the kill command.

So the answer to the last question is:

Evidently, the "tint2" program has code that, upon receiving the signal USR1, will reload its configuration file.

See for example http://unixhelp.ed.ac.uk/CGI/man-cgi?signal+7

Rmano
  • 32,167