Autostart icecast using systemd

To autostart icecast using systemd, create a unit file

vi /etc/systemd/system/icecast.service

Add following content

[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 to start on boot with

systemctl enable icecast

To start/stop/restart icecast, use

systemctl start icecast
systemctl stop icecast
systemctl restart icecast
Need help with Linux Server or WordPress? We can help!

One thought on “Autostart icecast using systemd

  • 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

Leave a Reply

Your email address will not be published. Required fields are marked *