Skip to content

Systemd service - fail on boot - have to add dependencies #125

Description

@FGIKCM

Hello,

With your minimal example of Systemd service (https://github.com/nextcloud/notify_push), it failed to start at boot on my host, as needed dependencies where not started.

Example:

Aug 20 10:07:55 myserver systemd[1]: Started The PHP 7.4 FastCGI Process Manager.
Aug 20 10:07:55 myserver systemd[1]: Started Nextcloud - Push daemon for Nextcloud clients.
Aug 20 10:07:55 myserver notify_push[890]: Error:
Aug 20 10:07:55 myserver notify_push[890]:    0: #033[91mFailed to connect to Nextcloud database#033[0m
Aug 20 10:07:55 myserver notify_push[890]:    1: #033[91merror communicating with the server: No such file or directory (os error 2)#033[0m
Aug 20 10:07:55 myserver notify_push[890]:    2: #033[91mNo such file or directory (os error 2)#033[0m
Aug 20 10:07:55 myserver notify_push[890]: Location:
Aug 20 10:07:55 myserver notify_push[890]:    #033[35m/tmp/krankerl.AjpQJOOqCJm6/notify_push/src/storage_mapping.rs#033[0m:#033[35m57#033[0m
Aug 20 10:07:55 myserver notify_push[890]: Backtrace omitted.
Aug 20 10:07:55 myserver notify_push[890]: Run with RUST_BACKTRACE=1 environment variable to display it.
Aug 20 10:07:55 myserver notify_push[890]: Run with RUST_BACKTRACE=full to include source snippets.
Aug 20 10:07:55 myserver systemd[1]: notify_push.service: Main process exited, code=exited, status=1/FAILURE
Aug 20 10:07:55 myserver systemd[1]: notify_push.service: Failed with result 'exit-code'.

To fix it, I added After=, to be sure everything else is started before (Apache, PHP-FPM, MySQL, Redis...)

[Unit]
Description = Push daemon for Nextcloud clients
Documentation=https://github.com/nextcloud/notify_push
After=apache2.service php7.4-fpm.service mysql.service redis.service

You should perhaps add some clues on this on your wiki page.

Best regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions