Autostart icecast using systemd
To autostart icecast using systemd, create a unit file
1 |
vi /etc/systemd/system/icecast.service |
Add following content
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
[Unit] Description=Icecast Network Audio Streaming Server After=network.target [Service] Type=simple ExecStart=/usr/local/bin/icecast -c /etc/icecast/icecast.xml ExecReload=/bin/kill -HUP $MAINPID User=icecast Group=icecast WorkingDirectory=/home/icecast/ [Install] WantedBy=multi-user.target |
Enable icecast start on boot with
1 |
systemctl enable icecast |
To start/stop/restart icecast, use
1 2 3 |
systemctl start icecast systemctl stop icecast systemctl restart icecast |
Don’t forget to
groupadd icecast
useradd icecast -g icecast -d /home/icecast
if [ ! -d “/home/icecast ]; then mkdir /home/icecast ; fi
and after the systemctl start icecast, ensure it successfully ran and didn’t exit:
systemctl status icecast && journalctl -xe