Skip to content

Commit

Permalink
Run systemd service as scream user
Browse files Browse the repository at this point in the history
Add scripts to configure additional user scream for systemd service
  • Loading branch information
catango committed Oct 27, 2024
1 parent 705559e commit 2d77369
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Receivers/unix/debian/scream.postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/sh

useradd \
--no-user-group \
--create-home \
--home-dir /var/lib/scream \
--shell /usr/sbin/nologin \
--groups audio \
--system \
scream

# Enable and start the service
systemctl disable scream.service

# Explicitly exit 0
exit 0
13 changes: 13 additions & 0 deletions Receivers/unix/debian/scream.prerm
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh

# Disable and stop the service
systemctl disable --now scream.service

# Remove the user
userdel scream

# Clean up the data directory (don't worry about program files, 'dpkg' handles that!)
rm -rf /var/lib/scream

# Explicitly exit 0
exit 0
1 change: 1 addition & 0 deletions Receivers/unix/debian/scream.service
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Description=Scream audio receiver
After=sound.target

[Service]
User=scream
ExecStart=/usr/bin/scream -o alsa
ExecReload=/bin/pkill scream
RestartSec=5
Expand Down

0 comments on commit 2d77369

Please sign in to comment.