i want to load a script at boot time using the instructions provided at this site: http://tutos.readthedocs.io/en/latest/source/ndg.html
If it is working, it’s great! Now we’ll daemonize it by using systemd. Of course you can use another init system (like Ubuntu upstart. Just search for “how to run script after bootâ€.
Create new service file /usr/lib/systemd/system/gunicorn_ourcase.service and insert this:
[Unit]
Description=Ourcase gunicorn daemon
[Service]
Type=simple
User=nginx
ExecStart=/var/www/test/gunicorn_start.sh
[Install]
WantedBy=multi-user.target
now enable it as with other units:
systemctl enable gunicorn_ourcase
but when i want to run the command systemctl enable gunicorn_ourcase it prompts:
Failed to execute operation: No such file or directory
when i add the --user switch, this error will occure: Failed to get D-Bus connection: Connection refused
what is the problem with the command and what can i do?