Skip to main content
15 events
when toggle format what by license comment
Mar 24, 2017 at 12:34 answer added string theorist timeline score: 3
Mar 23, 2017 at 15:46 comment added Mark Stosberg Have you reviewed the various differences between running a command manually and via systemd? unix.stackexchange.com/a/339645/20239
Mar 23, 2017 at 13:55 comment added string theorist @meuh But to answer your question directly, based on the server log, it receives the message "From Console". As if I entered the text in the console that I started it in.
Mar 23, 2017 at 13:48 comment added string theorist So to be clear: without backgrounding the process, I am able to run the script fine, directly from terminal. But it fails as a service, receiving an EXIT signal "from console" (according to the binary's log). If it try to background the process from within the script, using nohup, or &, it interprets it as an "EXIT" signal.
Mar 23, 2017 at 13:48 comment added string theorist @meuh I'll try the strace idea soon. Here's something strange I picked up after trying your suggestions: When I add the & at the end of the call to the binary, in order to background the process, or if I start the process with nohup, or if i add the /dev/null, I experience the same symptoms when starting the script manually from terminal, as if I were starting the service, or running the script as a startup script. So it appears that the systemd service is trying to background it, but the binary interprets it as an exit signal.
Mar 23, 2017 at 13:03 history tweeted twitter.com/StackUnix/status/844897440948015104
Mar 23, 2017 at 12:26 comment added meuh So from where is your server getting an exit command? Is it reading stdin? If you ./run.sh <&- or ./run.sh </dev/null does it die too? If your server is a binary, not a script, you can try using strace to see what system calls it does and so perhaps find the one making it decide to exit.
Mar 23, 2017 at 12:17 comment added string theorist @meuh If by "messages from your command" you mean the data log of the script, it writes its own log as well, and in that log it says that the server receives the command EXIT, and so it shuts down everything immediately. I know that it's not a matter of waiting for the X11 display to start, because even after logging in and starting the service manually through the terminal emulator, I have the same problem.
Mar 23, 2017 at 12:00 comment added meuh Comment out the StandardOutput= line and check for messages from your command. If you want to use the X11 display you may need to set more in the environment, and wait longer for X11 to be ready.
Mar 23, 2017 at 11:59 history edited string theorist CC BY-SA 3.0
added 99 characters in body
Mar 23, 2017 at 8:04 comment added string theorist @13nilux Hi, I've added the info to the original post above. Thanks!
Mar 23, 2017 at 8:03 history edited string theorist CC BY-SA 3.0
added 493 characters in body
Mar 23, 2017 at 7:43 comment added 13dimitar Could you show the output of sudo systemctl status <yourservice> -l?
Mar 23, 2017 at 7:41 review First posts
Mar 23, 2017 at 7:42
Mar 23, 2017 at 7:38 history asked string theorist CC BY-SA 3.0