Last active
December 18, 2015 15:08
-
-
Save shurikk/5802069 to your computer and use it in GitHub Desktop.
detach non-daemonized application from current session with user switching
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# * script is executed by root | |
# * will detach from current session | |
su -p user <<"EOF" | |
/path/to/app -o option1 > /path/to/app.log 2> /path/to/app-errors.log & | |
echo $! > /path/to/app.pid | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment