nextcloud / nextcloud/notify_push

Systemd service - fail on boot - have to add dependencies

Open
#125 10 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

documentation
Dominant language
Rust
Stars
344
Forks
64
Avg merge
2d 10h
Merged PRs (30d)
5

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the minimal systemd service example linked in the issue and the shown [Unit] configuration; first inspect boot ordering with the listed Apache, PHP-FPM, MySQL, and Redis dependencies. Done means the service starts reliably at boot and the wiki or service guidance explains the required ordering.

Written by the indexing model from the issue text.

Assessment

Tech stack
apache, mysql, php, redis
Domain
devops, infrastructure
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.