diff options
Diffstat (limited to '')
| -rwxr-xr-x | rsplayer.rc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/rsplayer.rc b/rsplayer.rc index 706387b..ccc2bc9 100755 --- a/rsplayer.rc +++ b/rsplayer.rc | |||
| @@ -63,6 +63,14 @@ rsplayer_start() | |||
| 63 | echo " connect to the daemon socket. Set rsplayer_user in rc.conf." | 63 | echo " connect to the daemon socket. Set rsplayer_user in rc.conf." |
| 64 | fi | 64 | fi |
| 65 | 65 | ||
| 66 | # daemon(8) opens the log file (-o) before exec'ing rsp and before | ||
| 67 | # dropping privileges, but the state dir is only created by rsp itself — | ||
| 68 | # create both up front so the log can open and stays user-owned/readable. | ||
| 69 | install -d -o "${rsplayer_user}" -g "${rsplayer_group}" -m 700 "${state_dir}" | ||
| 70 | if [ ! -e "${state_dir}/rsplayer.log" ]; then | ||
| 71 | install -o "${rsplayer_user}" -g "${rsplayer_group}" -m 600 /dev/null "${state_dir}/rsplayer.log" | ||
| 72 | fi | ||
| 73 | |||
| 66 | echo "Starting rsplayer as ${rsplayer_user} (HOME=${rsplayer_home})." | 74 | echo "Starting rsplayer as ${rsplayer_user} (HOME=${rsplayer_home})." |
| 67 | /usr/bin/env HOME="${rsplayer_home}" \ | 75 | /usr/bin/env HOME="${rsplayer_home}" \ |
| 68 | /usr/sbin/daemon -u "${rsplayer_user}" -o "${state_dir}/rsplayer.log" \ | 76 | /usr/sbin/daemon -u "${rsplayer_user}" -o "${state_dir}/rsplayer.log" \ |
