How to use systemctl to restart a service
<p>I created a system service which can be start/stop/restart by running the command service. But when I try to do it by systemctl I always got below error. I don't know what wrong with my script file. Why it can be managed by service not systemctl?</p>

<pre><code># systemctl restart cooltoo_storage
Job for cooltoo_storage.service failed because the control process exited with error code. See "systemctl status cooltoo_storage.service" and "journalctl -xe" for details.
</code></pre>

<p>Below is the output of "systemctl status cooltoo_storage.service"</p>

<pre><code># systemctl status cooltoo_storage.service
</code></pre>

<p>● cooltoo_storage.service - LSB: cooltoo storage provider
   Loaded: loaded (/etc/rc.d/init.d/cooltoo_storage)
   Active: failed (Result: exit-code) since Tue 2016-05-03 17:17:12 CST; 1min 29s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 32268 ExecStart=/etc/rc.d/init.d/cooltoo_storage start (code=exited, status=203/EXEC)</p>

<pre><code>May 03 17:17:12 Cool-Too systemd[1]: Starting LSB: cooltoo storage provider...
May 03 17:17:12 Cool-Too systemd[1]: cooltoo_storage.service: control  process exited, code=exited status=203
May 03 17:17:12 Cool-Too systemd[1]: Failed to start LSB: cooltoo storage provider.
May 03 17:17:12 Cool-Too systemd[1]: Unit cooltoo_storage.service entered failed state.
May 03 17:17:12 Cool-Too systemd[1]: cooltoo_storage.service failed.
</code></pre>

<p>Below is my script file /etc/init.d/cooltoo_storage,</p>

<pre><code>### BEGIN INIT INFO
# Provides:          cooltoo storage provider
# Required-Start:    $local_fs $remote_fs $network $time $named
# Should-Start: $time sendmail
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: cooltoo storage provider
# Description:       cooltoo storage provider
# chkconfig: 2345 90 90
### END INIT INFO

start() {
  nginx -c /data/nginx/nginx.config
}

stop() {
        nginx -c /data/nginx/nginx.config -s stop
}

restart() {
        nginx -c /data/nginx/nginx.config -s reload
}

status() {
        echo ''
}



action="$@"
if [[ "$MODE" == "auto" &amp;&amp; -n "$init_script" ]] || [[ "$MODE" == "service" ]]; then
  action="$1"
  shift
fi


case "$action" in
start)
  start ; exit $?;;
stop)
  stop ; exit $?;;
restart)
  restart ; exit $?;;
status)
  status ; exit $?;;
*)
  echo "Usage: $0 {start|stop|restart|force-reload|status|run}"; exit 1;
esac
</code></pre>