How do services work

zoidberg51

Still Fresh
Joined
Sep 13, 2015
Messages
7
Hi,

I was wondering how do services work.

Is there a command I can use to start and stop services?

Thanks, Shaun.
 

levi

Still fresh, damnit!
Joined
Oct 6, 2008
Messages
11,825
Location
Somewhere off the coast of the EU
Under a sysvinit system like the Pandora OS:

/etc/init.d/NAME start|stop|restart|status|reload

On a systemd system like Pyra OS:

systemctl start|stop|restart|status|reload NAME
 

rygD

Nihilistic Mystic
Joined
Feb 28, 2014
Messages
7,420
Location
Everywhere
SEE! These are exactly the sort of problems systemd has introduced. This is exactly one of the issues I ran into when I first started using it.
 
  • Like
Reactions: rSl

rygD

Nihilistic Mystic
Joined
Feb 28, 2014
Messages
7,420
Location
Everywhere
RTFM and get over it.
Ah, but see, that is only one minor and commonly seen problem, and they get much worse very quickly the more you look. I suppose if the only thing you care about is using it (instead of sharing, such as the back and forth between BSD and Linux, which is something I used to think was a great idea) there are no problems. Not only does it create more work for the people that have to learn to use systemd, it makes more work for those that don't. I suppose this is acceptable? To me, it is not.
 

rygD

Nihilistic Mystic
Joined
Feb 28, 2014
Messages
7,420
Location
Everywhere
On a debian system I use the "service" command anyway, works more or less the same no matter what init system you use.
I used that a LOT in the past. Last time I tried was on a RHEL VM and it didn't work. I stopped using it pretty much immediately so that I wouldn't continue to rely on it and forget how things are done with systemd. Maybe it is just Red Hat that doesn't use it, or those VMs, since I don't know much about them other than they were used to teach all the new RHEL stuff. With previous versions I used "service" worked just fine.
 

levi

Still fresh, damnit!
Joined
Oct 6, 2008
Messages
11,825
Location
Somewhere off the coast of the EU
I don't have a 'service' command in my sbin folder on Arch (where /sbin is just a symlink to /usr/bin anyway), and it doesn't seem to be a command in SZ either so I assume it's a Debian-ism. But it's worth knowing for those of us with plans to buy a Pyra.
 

rygD

Nihilistic Mystic
Joined
Feb 28, 2014
Messages
7,420
Location
Everywhere
Maybe so. Other than CentOS and RHEL, every distro I remember using it with was Debian based.
 

HelenF

Very Active Member
Joined
Jun 22, 2013
Messages
448
Location
UK
On Fedora I have the "service" command and it tells me what it's redirecting to, so maybe I'll remember some day.

Code:
# service NetworkManager restart
Redirecting to /bin/systemctl restart  NetworkManager.service
 
Top