How do services work


zoidberg51

Still Fresh
Joined
Sep 13, 2015
Messages
8
Hi,

I was wondering how do services work.

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

Thanks, Shaun.
 
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
 
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
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.
 
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.
 
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.
 
Maybe so. Other than CentOS and RHEL, every distro I remember using it with was Debian based.
 
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
 
Back
Top