RSS Feed for This PostCurrent Article

Tip: Use ‘at now’ to daemonize tasks

Have you ever noticed how your OpenSSH session hangs on logout if you start something in the background? This is intentional on the part of the OpenSSH developers, but it’s annoying for system administrators who do a lot of backgrounding of things. Certainly you can force-quit your hung SSH session with the “~.” trick but that sucks, too. A quick fix I use is the ‘at’ command. In this example I want to start the Tivoli Storage Manager client daemon in the background:

echo “/opt/tivoli/tsm/client/ba/bin/dsmc schedule > /dev/null” | \
/usr/bin/at now

Customize as necessary, but you see the trick. You do need the atd daemon running to get it to work.

| Comments

Trackback URL

Post a Comment

 

Please note that while in principle I don't mind promotion of a non-personal web site or blog in the fields below, any comments that are off-topic, derogatory, or spam-like will likely be removed at my discretion.