Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 10-19-2016, 06:31 AM   #1
Registered: Jun 2008
Location: Torino, Italy
Posts: 66

Rep: Reputation: 17
Is there an easy way to convert sysV to systemd scripts? Or add dependencies to a sysV script?

I just installed Snort on a Fedora 24 system. The official RPMs from are made for Fedora 21 (don't know how relevant that is but mentioning it just in case). It includes a sysV init script: /etc/init.d/snortd.

Just set up the configuration and used systemctl to enable the service at boot, everything fine except that... snort starts too early. The network has not been initialized yet, so it complains that the interface is down and exits.

Oct 19 12:35:06 localhost snort[405]: FATAL ERROR: Can't start DAQ (-1) - enp2s0: That device is not up!
It only works if I start it by hand after login (sudo systemctl start snortd).

So I tried creating a directory '/etc/systemd/system/snortd.wants' and putting there a symlink to NetworkManager.service. I was hoping this would make snort start after NetworkManager does, but it didn't solve the problem. I guess sysV init scripts cannot have dependencies the way a systemd service would.

Any suggestions? Thanks.
Old 10-19-2016, 06:39 AM   #2
LQ Guru
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (current), FreeBSD, Win10, It varies
Posts: 9,952

Rep: Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148
Fedora 16 Chapter 7. Services and Daemons

if [ check to see if needed services is running yet ] ; then run that code .. place within the file that is needing to be started after the other service is started. loop it. ????

or if the system is calling for this one to be started first, maybe do this
if [ ! network ] ; then 
start network
start this service
OH here I found this too, I haven't read it but it might be useful

SysVinit to Systemd Cheatsheet Fedora

search pattern used: sysV starting services in order

Last edited by BW-userx; 10-19-2016 at 06:50 AM.
Old 10-19-2016, 06:51 AM   #3
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 19,974

Rep: Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633
You need to create a service file for it that defines the startup dependency. Simple search found two almost identical examples - Fedora and Ubuntu.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
FYI 14.2 change: SysV kill-scripts running at boot instead of shutdown ljb643 Slackware 3 08-01-2016 03:39 PM
How do SysV init scripts exacly work? glukoz.ziewa Linux - Server 2 11-29-2012 08:11 AM
getting bootsplash progress bar working with recent sysv-rc scripts (2.86+) gringer Debian 10 04-28-2007 04:10 AM
SysV-Init scripts...change order during bootstrapping? tsw Mandriva 2 07-02-2004 08:39 AM
sysV vs bsd starting scripts sqn Linux From Scratch 3 06-16-2002 01:42 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:37 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration