Register a domain and help support LQ
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 09-21-2012, 10:24 AM   #1
Registered: Apr 2012
Location: Florida
Distribution: Many
Posts: 111

Rep: Reputation: Disabled
Algorithm to Determine if Using Initd Or Systemd

How can I (actually how can a program of mine) determine if the system it wakes up on is interacting with services via initd or systemd? I have a program which has to be able to interact with services in both environments.

Thank you in advance for any light you can shed on this.
Old 09-21-2012, 10:28 AM   #2
LQ Guru
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 5,894

Rep: Reputation: 1358Reputation: 1358Reputation: 1358Reputation: 1358Reputation: 1358Reputation: 1358Reputation: 1358Reputation: 1358Reputation: 1358Reputation: 1358
You could probably see which file exists ...

But, application programs don't interact directly with either of these processes, and those programs that do ought not care how the services that they require are being rendered to them.

You really want to design your program so that it is agnostic to these issues. If you do for example have a dependency in the installation process, then you should first detect what you think to be the case, then stop and ask the installing user to confirm your assessment and if need be to overrule it.

Furthermore, when your program is in service, it should continuously do some kind of "stink test" to recognize when it is in a potentially-damaging situation where it concludes that, "the configuration option that I was given just can't be right ... or maybe it's no longer right." (The user could, after all, switch his system from one to the other without telling you, and you surely don't want yours to be the piece-of-software that just got egg-faced in some sysadmin forum somewhere!)

For programs like these, a good strategy is:
  • "I think I know the answer, but ..."
  • "... I'm going to oblige you to tell me one way or the other, and ..."
  • "... I still won't quite believe you, nor trust that what you said will always remain true."

Last edited by sundialsvcs; 09-21-2012 at 10:32 AM.
Old 09-21-2012, 10:43 AM   #3
Registered: Apr 2012
Location: Florida
Distribution: Many
Posts: 111

Original Poster
Rep: Reputation: Disabled
It's not an installation issue. My program determines various information about services and sends it back to a control center via the Internet. If the environment is using systemd, and my program thinks it's using initd, it will report false information. I need an algorithm to know which system is in use.


services, systemd

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 On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Boot Delay 30min: systemd-analyze blame systemd-tmpfiles-setup.service BGHolmes Fedora 0 07-27-2011 09:02 AM
initd or something of the kernel EAD Linux From Scratch 3 03-04-2006 04:22 AM
Easy, Where is initd log file? neozero62 Linux - Newbie 2 11-10-2004 04:50 PM
Algorithm to determine status of audio stream pembo13 Programming 0 10-31-2004 10:07 PM
what is super-server deamon initd for? marlor Linux - Software 1 07-15-2004 06:58 PM

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

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration