Supervisord on linux CentOS 7 only works when run with root Supervisord on linux CentOS 7 only works when run with root linux linux

Supervisord on linux CentOS 7 only works when run with root


For all the people out there having the same problem, this works for me.

cd echo_supervisord_conf > /etc/supervisord.conf# content of /etc/supervisord.conf ...[supervisorctl]serverurl=unix:///tmp/supervisor.sock ; use a unix:// URL  for a unix socket[inet_http_server] ; inet (TCP) server disabled by defaultport=*:9001        ; (ip_address:port specifier, *:port for all iface) - I had all this wrong from my original config.username=userpassword=passwd

Paste this content into /etc/rc.d/init.d/supervisord ( I´m not the owner of this script, by now i don´t remember where i got it from )

#!/bin/sh## /etc/rc.d/init.d/supervisord## Supervisor is a client/server system that# allows its users to monitor and control a# number of processes on UNIX-like operating# systems.## chkconfig: - 64 36# description: Supervisor Server# processname: supervisord# Source init functions. /etc/rc.d/init.d/functionsprog="supervisord"prefix="/usr/local/"exec_prefix="${prefix}"prog_bin="${exec_prefix}/bin/supervisord -c /etc/supervisord.conf"PIDFILE="/var/run/$prog.pid"start(){       echo -n $"Starting $prog: "       daemon $prog_bin --pidfile $PIDFILE       sleep 1       [ -f $PIDFILE ] && success $"$prog startup" || failure $"$prog startup"       echo}stop(){       echo -n $"Shutting down $prog: "       [ -f $PIDFILE ] && sleep 1 && killproc $prog || success $"$prog shutdown"       echo}case "$1" in start)   start ;; stop)   stop ;; status)       status $prog ;; restart)   stop   start ;; *)   echo "Usage: $0 {start|stop|restart|status}" ;;esac

Make the script executable and register it as a service

sudo chmod +x /etc/rc.d/init.d/supervisordsudo chkconfig --add supervisordsudo chkconfig supervisord on# Start the servicesudo service supervisord start# Stop the servicesudo service supervisord stop# Restart the servicesudo service supervisord restart