A
A
Anton2018-01-19 23:07:40
linux
Anton, 2018-01-19 23:07:40

How to normally run a command in centos?

Now I start icecast via shell with the command

/opt/icecast/latest/bin/icecast -c /opt/icecast/latest/etc/icecast.xml -b

How to ennoble this thing and
1. Add start to autoload
2. It is desirable, but not necessary, to make a normal command like ala-start-stop
3. It is advisable to add on / off in ispmanager to the service tab to restart with the button
I have centos7, vps, ispmanager5

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
rino906, 2018-01-20
@rino906

create file /etc/systemd/system/icecast.service and write to it

[Unit]
Description=Icecast Network Audio Streaming Server
After=network.target

[Service]
ExecStart=/opt/icecast/latest/bin/icecast -c /opt/icecast/latest/etc/icecast.xml -b
ExecReload=/bin/kill -HUP $MAINPID

[Install]
WantedBy=multi-user.target

autostart: systemctl enable icecast.service
start: systemctl start icecast.service
stop: systemctl stop icecast.service
reload: systemctl reload icecast.service
unfortunately, I can't tell you about adding to ispmanager

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question