Create daemon.service - #12
Open
fzahir786 wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new systemd unit (daemon.service) to start a daemon at boot with defined dependencies and startup/shutdown timeouts.
Changes:
- Introduces
systemd/system/daemon.servicewithType=notifyandExecStart=/usr/bin/mydaemon --config /etc/mydaemon.conf. - Configures ordering/dependencies on
network.target,database.service, andlogger.service. - Sets
TimeoutStartSec=30,TimeoutStopSec=10, and enables boot startup viaWantedBy=multi-user.target.
| @@ -0,0 +1,12 @@ | |||
| [Unit] | |||
| Description=My daemon service | |||
There was a problem hiding this comment.
Description=My daemon service is too generic and doesn’t explain what the unit does. Please update to a clear, specific description of the daemon’s purpose.
Suggested change
| Description=My daemon service | |
| Description=Systemd unit managing the /usr/bin/mydaemon background service |
| Type=notify | ||
| ExecStart=/usr/bin/mydaemon --config /etc/mydaemon.conf | ||
| TimeoutStartSec=30 | ||
| TimeoutStopSec=10 |
There was a problem hiding this comment.
This unit doesn’t specify any Restart= behavior, so it defaults to Restart=no. If this daemon is intended to be non-critical and should self-recover, add Restart=on-failure and a RestartSec= delay; if it’s critical, consider explicitly documenting/justifying the no-restart choice to match the restart directive guidelines.
Suggested change
| TimeoutStopSec=10 | |
| TimeoutStopSec=10 | |
| Restart=on-failure | |
| RestartSec=5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.