1
1
Fork 0
mirror of https://tildegit.org/solderpunk/molly-brown synced 2024-05-28 02:06:06 +02:00

Merge pull request 'Add initial systemd service example' (#3) from strega-nil/molly-brown:add-systemd into master

This commit is contained in:
solderpunk 2020-05-23 11:21:25 -04:00
commit 79dd948a9f
2 changed files with 27 additions and 7 deletions

View File

@ -45,14 +45,22 @@ Currently Molly Brown just runs like an ordinary program, without
daemonising itself. You'll need to use another program, like the one daemonising itself. You'll need to use another program, like the one
at `http://libslack.org/daemon/`, to handle daemonising. at `http://libslack.org/daemon/`, to handle daemonising.
Currently Molly Brown is not integrated with any kind of init system, Currently Molly Brown is only integrated with systemd, so if you're
so you'll have to handle getting it to start on boot up yourself. If using anything else you'll have to handle getting it to start on boot up
you are using a sufficiently right-headed operating system, the yourself. If you are using a sufficiently right-headed operating
easiest way to do this is by putting your call to `daemon` (or system, the easiest way to do this is by putting your call to
whatever else you use) in `/etc/rc.local`. `daemon` (or whatever else you use) in `/etc/rc.local`.
If you write a working systemd unit file for Molly Brown, please feel Setting up with systemd should be reasonably easy; copy
free to share it with me and I'll get it into the repo. `molly-brown.service.example` from this directory to
`/etc/systemd/system/molly-brown.service`. Then, make any necessary
changes for your setup, and run the following:
```sh
# systemctl daemon-reload
# systemctl enable molly-brown.service
# systemctl start molly-brown.service
```
Note that Golang programs are unable to reliably change their UID once Note that Golang programs are unable to reliably change their UID once
run (a source of constant frustration to me!). So don't start it as run (a source of constant frustration to me!). So don't start it as

View File

@ -0,0 +1,12 @@
[Unit]
Description=Molly Brown gemini server
After=network.target
[Service]
Type=simple
Restart=always
User=molly
ExecStart=/usr/local/bin/molly-brown -c /etc/molly.conf
[Install]
WantedBy=multi-user.target