LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 10-19-2016, 06:31 AM   #1
irey
Member
 
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 snort.org 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.

Code:
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
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
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
Code:
if [ ! network ] ; then 
start network
start this service
fi
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
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

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


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:10 AM.

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