Add systemd service #12

Open
opened 4 months ago by unclesamulus · 0 comments

Here is a systemd service sample \o/

rs-short.service

[Unit]
Description=rs-short
Documentation=https://git.42l.fr/42l/rs-short
After=network.target

[Service]
Type=simple
User=root # Maybe better with dedicated user
WorkingDirectory=/var/www/rs-short
ExecStart=/var/www/rs-short/target/release/rs-short
Restart=on-failure

[Install]
WantedBy=multi-user.target

Usage

First compile rs-short: cargo run --release

(Considered as root logged user, with soure code in /var/www/rs-short)

cp rs-short.service /etc/systemd/sytem/rs-short.service
systemctl daemon-reload
systemctl enable --now rs-short.service
Here is a systemd service sample \o/ ## `rs-short.service` ```text [Unit] Description=rs-short Documentation=https://git.42l.fr/42l/rs-short After=network.target [Service] Type=simple User=root # Maybe better with dedicated user WorkingDirectory=/var/www/rs-short ExecStart=/var/www/rs-short/target/release/rs-short Restart=on-failure [Install] WantedBy=multi-user.target ``` ## Usage First compile rs-short: `cargo run --release` (Considered as root logged user, with soure code in /var/www/rs-short) ```bash cp rs-short.service /etc/systemd/sytem/rs-short.service systemctl daemon-reload systemctl enable --now rs-short.service ```
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.