Equivalent to /etc/init.d in Fedora
Heya fedora peeps.
Quick question and very basic for you guys. Im a Debain fan but im helping a friend install a Fedora 16 on his laptop. Say if i want to turn off ssh, i normally just go /etc/init.d then chmod -x ssh. But how do i do that from the command line on a fedora system ? Basic, i've read something about systemctl :S, but would prefer doing chmod -x, if possible in a Fedora environment. Thanks for your help |
You can find them in /etc/rc.d/init.d.
|
Perhaps
Code:
service ssh disable |
where did this idea of stopping it being executable come from? I've never heard of that and just sounds crude and clunky.
|
I believe it's the "standard" UNIX way of disabling init scripts. It's still the standard way of disabling Slackware's init scripts.
|
Yep, standard on Slackware, because the main init script checks if they are set to executable and only runs them in that case. But not the correct way on Debian.
|
that sounds horrible. Wonderfully simple, sure, but that doesn't make it good. the executable flag means the file is execut**ABLE**, not that it should be executed. That's a hack.
|
Quote:
You have many different init scritpts in the init path and a main script check for the ones with the executable flag and run them. Utils and scripts like chkconfig, service [name] start/stop/restart, ntsysv were created to make the daemons-services management easier. |
Forget everything you know about /etc/init.d. Examine the files in /usr/lib/systemd/system. The *.service files control services. To make one active, create a link in /usr/lib/systemd/system/multi-user.target.wants; delete the link to disable a service. Suffering from congenital indolence, as I oftentimes do, I use "systemctl" to do all that.
> systemctl status sshd.service sshd.service - OpenSSH server daemon Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled) Active: active (running) since Tue, 31 Jul 2012 06:58:26 -0700; 6s ago Process: 7905 ExecStartPre=/usr/sbin/sshd-keygen (code=exited, status=0/SUCCESS) Main PID: 7910 (sshd) CGroup: name=systemd:/system/sshd.service └ 7910 /usr/sbin/sshd -D > systemctl stop sshd.service sshd.service - OpenSSH server daemon Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled) Active: inactive (dead) since Tue, 31 Jul 2012 06:59:56 -0700; 3s ago Process: 7910 ExecStart=/usr/sbin/sshd -D $OPTIONS (code=exited, status=0/SUCCESS) Process: 7905 ExecStartPre=/usr/sbin/sshd-keygen (code=exited, status=0/SUCCESS) CGroup: name=systemd:/system/sshd.service [notice that the service is still loaded, or enabled] > systemctl disable sshd.service rm '/etc/systemd/system/multi-user.target.wants/sshd.service' [now the sshd service will no longer start - reverse the process, enable and start, if you want to run sshd again] > systemctl --help > man systemctl IMHO, systemd is a lot easier to deal with than all of those /etc/init.d or /etc/rc.d files. My /etc/init.d directory is empty. (The *.wants directories coorespond to different run-levels.) |
All times are GMT -5. The time now is 08:28 AM. |