I have an application that needs to run as a service. So, I threw together a quick service file (myapp.service) that looks like this:
Code:
[Unit]
Description=My application
After=multi-user.target
[Service]
ExecStart=/usr/local/bin/MyApp
Type=simple
User=myuser
WorkingDirectory=/home/myuser
Restart=always
RestartSec=5
TimeoutStartSec=30
[Install]
WantedBy=multi-user.target
When I log in as myuser and run /usr/local/bin/MyApp from /home/myuser, it runs fine.
When I do "systemctl start myapp" however, it hangs until I ctrl-c. It doesn't print any output, and nothing goes to journalctl. It just sits there, well past the 30 second timeout. When I boot the system and SSH into it, the service is always listed as enabled but dead.
Anyone have some tips to debug this?
Here's the added weirdness... without getting too far into the weeds, this system gets created from a disk image. When I take that image and run it, this app and service file work fine! But if I take that image and run it through
mender-convert, then the service behaves this way. So, I know the app and the service file are fine... but I have no way of debugging to figure out what systemctl is choking on in the mender image...