flood icon indicating copy to clipboard operation
flood copied to clipboard

[Request] examples of systemd service file with tmux and screen

Open noraj opened this issue 9 years ago • 5 comments

You said you used screen to detach flood from shell but I tried to write a systemd service (/etc/systemd/system/flood.service) with tmux:

[Unit]
Description=flood web interface for rTorrent
After=network.target

[Service]
Type=forking
KillMode=none
User=myuser
ExecStart=/usr/bin/tmux new-session -s flood -n flood -d npm run start:production
ExecStop=/usr/bin/bash -c "/usr/bin/tmux send-keys -t flood C-q && while pidof gulp > /dev/null; do sleep 0.5; done"
WorkingDirectory=/home/myuser/flood/
Restart=on-failure

[Install]
WantedBy=multi-user.target

But it doesn't work.

It would be great if you can find a way to provide some examples of systemd service file with tmux and screen.

noraj avatar Jan 04 '17 00:01 noraj

Another approach: https://aur.archlinux.org/cgit/aur.git/tree/flood.service?h=flood-git

2buisson avatar Jan 04 '17 18:01 2buisson

  • I installed nodejs and npm globally.
  • I created a new user flood.
  • I installed flood in /srv/flood and chown it to flood user
  • I change /etc/systemd/system/flood.service to:
[Unit]
Description=Flood rTorrent Web UI
After=network.target

[Service]
WorkingDirectory=/srv/flood
ExecStart=/usr/bin/npm start --production /srv/flood
User=flood

[Install]
WantedBy=multi-user.tar

It works. But no killing via systemd. And the whole process should be written in the README.

noraj avatar Jan 04 '17 23:01 noraj

Things like this belong in the wiki rather than README (even my screen recommendation should be in the wiki, if anywhere). I'd love to see your contributions there!

jfurrow avatar Jan 05 '17 03:01 jfurrow

Wiki article done: https://github.com/jfurrow/flood/wiki/Install-flood-with-a-service-account

noraj avatar Jan 07 '17 10:01 noraj

Thanks @noraj1337!!!

jfurrow avatar Jan 13 '17 05:01 jfurrow