Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Systemd deb package does not restart on install / redeploy / host restart #610

Closed
francisdb opened this issue Jun 23, 2015 · 4 comments
Closed

Comments

@francisdb
Copy link
Contributor

Just upgraded Ubuntu to 15.04 and switched the deb from upstart to systemd but when I install the new version the server is not restarted. I have to manually call sudo service myapp restart

using the default sbt-native-packager version that comes with Playframework 2.4

sudo dpkg -i myapp_0.0.1-SNAPSHOT_all.deb
(Reading database ... 73053 files and directories currently installed.)
Preparing to unpack myapp_0.0.1-SNAPSHOT_all.deb ...
Removed symlink /etc/systemd/system/multi-user.target.wants/myapp.service.
Unpacking myapp (0.0.1-SNAPSHOT) over (0.0.1-SNAPSHOT) ...
Setting up myapp (0.0.1-SNAPSHOT) ...
Created symlink from /etc/systemd/system/multi-user.target.wants/myapp.service to /usr/lib/systemd/system/myapp.service.

previous log with upstart

sudo dpkg -i myapp_0.0.1-SNAPSHOT_all.deb
(Reading database ... 125443 files and directories currently installed.)
Preparing to unpack myapp_0.0.1-SNAPSHOT_all.deb ...
myapp stop/waiting
Unpacking myapp (0.0.1-SNAPSHOT) over (0.0.1-SNAPSHOT) ...
Setting up myapp (0.0.1-SNAPSHOT) ...
Installing new version of config file /usr/share/myapp/conf/routes ...
myapp start/running, process 18528
Processing triggers for ureadahead (0.100.0-16) ...
@ekuns
Copy link
Contributor

ekuns commented Jun 23, 2015

See #609 for a possible solution that involves creating a file in /etc/tmpfiles.d (Does Debian use tmpfiles.d?) That solution was tested under CentOS 7 with success, although we opted for a different solution that didn't require adding a new file.

@francisdb
Copy link
Contributor Author

For now I'm just restarting manually after install. I wonder if we'll see the same issue after reboot...

@francisdb
Copy link
Contributor Author

I can confirm that on server reboot the service does not start and can not be started

sudo service myapp status
● myapp.service - MyApp
   Loaded: loaded (/usr/lib/systemd/system/myapp.service; enabled; vendor preset: enabled)
   Active: activating (auto-restart) (Result: exit-code) since Wed 2015-06-24 04:42:31 EDT; 25s ago
  Process: 547 ExecStart=/usr/share/myapp/bin/myapp (code=exited, status=255)
 Main PID: 547 (code=exited, status=255)
   CGroup: /system.slice/myapp.service

Jun 24 04:42:31 data systemd[1]: myapp.service: main process exited, code=exited, status=255/n/a
Jun 24 04:42:31 data systemd[1]: Unit myapp.service entered failed state.
Jun 24 04:42:31 data systemd[1]: myapp.service failed.

tried to start it manually

cd /usr/share/myapp
sudo -u myapp bin/myapp
java.io.FileNotFoundException: /var/run/myapp/play.pid (No such file or directory)
...

fixed by

sudo mkdir /run/myapp
sudo chown myapp /run/myapp

conclusion:

Somehow /var/run/myapp is sometimes not being created / disappears

@francisdb francisdb changed the title Systemd deb package does not restart on redeploy Systemd deb package does not restart on install / redeploy / host restart Jun 24, 2015
@francisdb
Copy link
Contributor Author

I'll wait for the pull request on #609 and see if that fixes all issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants