How do I define an Ubuntu Linux16.04 systemd service for fastcgi-mono-server4 or xsp4?

I have already defined an Ubuntu Linux16.04 systemd service for apache2 by copying obex.service to apache2.service and changing the ExecStart line in apache2.service.

When I do the same thing for xsp4.service where xsp4 is a C# executable , systemctl status xsp4.service complains about: Failed to execute operation: Too many levels of symbolic links. Is it because in /etc/systemd/system , I "soft" linked xsp4.service using the command ln -s /usr/lib/systemd/user/xsp4.service xsp4.service?

Also, we would like to configure the ordering of service files so that apache2.service runs before xsp4.service.

Here is xsp4.service :

Description=Xsp4 service

ExecStart=/usr/bin/xsp4 --port 9000 --root /var/www/firstaspnet


Any help is greatly appreciated.

  • Too many symbolic links normally only happen if you have a recurrent symbolic link. I bet that it is chocking on the Alias parameter since you are using the same Alias= for the apache service you mentioned. You really do not need the [Install] section and/or the Alias= parameter to either apache or mono, kill that section in both unit files. – grochmal Jun 14 '16 at 11:55
  • @grochmal, I totally agree with you about "Too many symbolic links". What happens if I put Restart=always underneath ExecStart in the [Service] section? Where do I find the trace files to debug systemd? Thank you. – Frank Jun 14 '16 at 12:16
  • Sorry, i'm having difficulties to understand your comment. It is sometimes tricky to communicate using text only. If you could edit the question with results of what you tried after reading my comment it will be clearer i believe. Anyhow, one thing i understand and can say that: to get systemd log all you need to do it systemd -l status <service_name.service> – grochmal Jun 14 '16 at 12:41
  • @grochmal, When I run systemd status xsp4.service I get: Excess Arguments for the following xsp4.service: [Unit] Description=xsp4 [Service] Type=simple ExecStart=/usr/bin/xsp4 --root /var/www/firstaspnet --port 9000 Restart=always [Install] WantedBy=multi-user.target May I ask what I did wrong? Thank you. – Frank Jun 14 '16 at 13:06
  • To solve this issue we need at least: the content of /usr/lib/systemd/user/xsp4.service and the reason you are not using it diretly; the content of the default apache service unit on your systemd (systemctl cat apache2.service ?) and why you are not using it directly. You shoud also remove the [Install] section from your xsp4 service unit. – Timothée Ravier Jul 8 '17 at 12:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.