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

Notices


Reply
  Search this Thread
Old 09-21-2012, 10:24 AM   #1
Brandon9000
Member
 
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
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
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
Brandon9000
Member
 
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.
 
  


Reply

Tags
services, systemd



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

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:13 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