Comment 12 for bug 1185866

Revision history for this message
In , Billie-gentoo (billie-gentoo) wrote :

From reading the upstream bug this has been fixed since 3.13.6. The fix was adding /usr/bin/nohup in front of the /usr/bin/hp-config_usb_printer call.

The slackware patch and your patch are based on the fixed version 3.13.6 so apparently the fix was not correct as using nohup alone does not seem to work.

Backgrounding is required with or without using nohup. As you found out when backgrounding a command the semicolon is not needed anymore as it works as separator already.

There are other solutions as well:

Background the command using an ampersand and remove the semicolon like you did:
if [ something ]; then echo 1& else echo 2 ; fi

Use the semicolon as usual and background the complete if-then-else clause
if [ something ]; then echo 1; else echo 2 ; fi &

Or in a script by using line breaks:
if [ something ]
then
 echo 1 &
else
 echo 2
fi

Backgrounding the in/output is another issue. Apparently with nohup it should be used to prevent hanging in case the program sends or receives in/output. Best would be to redirect the complete in/output:
if [ something ]; then echo 1 >/dev/null 2>&1 </dev/null & else echo 2 ; fi