I am working on a project which is a mono EmailServer. I have tried adding a service to the systemd so that it starts up automatically during boot but I am having a problem.
I have created the script and added to /lib/systemd/system/emailserver.service
and then run ln -s /lib/systemd/system/emailserver.service /etc/systemd/system/emailserver.service
.
I have then executed systemd reload-daemon
followed by systemctl start emailserver.service
and then when I run ps -ef |grep -i emailserver
I can then see that mono EmailServer.exe
is running, all looking good so far.
However, when I reboot the server in the /var/log/messages
file it then contains the following error message
Jul 16 19:41:02 dev-server systemd[1]: emailserver.service holdoff
time over, scheduling restart. Jul 16 19:41:02 dev-server systemd[1]:
emailserver.service holdoff time over, scheduling restart. Jul 16
19:41:03 dev-server systemd[1]: emailserver.service holdoff time over,
scheduling restart. Jul 16 19:41:03 dev-server systemd[1]:
emailserver.service holdoff time over, scheduling restart. Jul 16
19:41:03 dev-server systemd[1]: emailserver.service holdoff time over,
scheduling restart. Jul 16 19:41:04 dev-server systemd[1]:
emailserver.service holdoff time over, scheduling restart. Jul 16
19:41:04 dev-server systemd[1]: emailserver.service start request
repeated too quickly, refusing to start.
In my emailserver.service script I have the following
[Unit]
Description=Boardies Email Server Startup Script
[Service]
ExecStart=/home/bits/EmailServer/start.email
Restart=always
[Install]
WantedBy=multi-user.target
I'm using OpenSuse 12.1
What am I doing wrong, thanks for any help you can provide.
UPDATE I have found out what is causing the program to stop working at bootup but I am not sure how I can fix this problem. My program relies on a MySQL database and I think my program is starting up before MySQL has started, how can I make my service not load until after MySQL has started up.