LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices

Reply
 
Search this Thread
Old 07-26-2012, 10:49 PM   #1
0men
Member
 
Registered: Mar 2011
Location: Gold Coast, Australia
Distribution: saline, centos, freeBSD, slackware
Posts: 180

Rep: Reputation: 22
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
 
Old 07-27-2012, 12:42 AM   #2
Slackyman
Member
 
Registered: Mar 2011
Location: Rome - Italy
Distribution: Slackware 13.1
Posts: 347

Rep: Reputation: 44
You can find them in /etc/rc.d/init.d.
 
Old 07-27-2012, 06:05 AM   #3
RockDoctor
Senior Member
 
Registered: Nov 2003
Location: Minnesota, US
Distribution: Fedora, Ubuntu
Posts: 1,224

Rep: Reputation: 251Reputation: 251Reputation: 251
Perhaps
Code:
service ssh disable
 
Old 07-27-2012, 06:18 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,406

Rep: Reputation: 1965Reputation: 1965Reputation: 1965Reputation: 1965Reputation: 1965Reputation: 1965Reputation: 1965Reputation: 1965Reputation: 1965Reputation: 1965Reputation: 1965
where did this idea of stopping it being executable come from? I've never heard of that and just sounds crude and clunky.
 
Old 07-27-2012, 06:34 AM   #5
cynwulf
Senior Member
 
Registered: Apr 2005
Distribution: OpenBSD, FreeBSD
Posts: 1,315

Rep: Reputation: Disabled
I believe it's the "standard" UNIX way of disabling init scripts. It's still the standard way of disabling Slackware's init scripts.
 
Old 07-27-2012, 09:04 AM   #6
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,592
Blog Entries: 2

Rep: Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047
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.
 
Old 07-27-2012, 09:21 AM   #7
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,406

Rep: Reputation: 1965Reputation: 1965Reputation: 1965Reputation: 1965Reputation: 1965Reputation: 1965Reputation: 1965Reputation: 1965Reputation: 1965Reputation: 1965Reputation: 1965
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.
 
Old 07-27-2012, 01:58 PM   #8
Slackyman
Member
 
Registered: Mar 2011
Location: Rome - Italy
Distribution: Slackware 13.1
Posts: 347

Rep: Reputation: 44
Quote:
Originally Posted by acid_kewpie View Post
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.
It's not "horrible": it's the BSD Init-Style!
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.
 
Old 07-31-2012, 09:08 AM   #9
hpfeil
Member
 
Registered: Nov 2010
Location: Tucson, Arizona US
Distribution: Slackware Current, custom kernel, amd64, Beyond LinuxFromScratch
Posts: 130
Blog Entries: 1

Rep: Reputation: Disabled
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.)
 
  


Reply


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
fedora equivalent to setenv preeteshbarretto Linux - Newbie 7 02-23-2009 10:41 AM
equivalent of Red Hat's rc.d/init.d in Debian? christopher94523 Debian 3 05-05-2008 11:22 AM
Slack equivalent of status, daemon and killproc from RH init.d/functions MQMan Slackware 1 07-26-2007 04:31 PM
equivalent command in fedora pa_ash Linux - Newbie 1 06-28-2004 02:52 AM
equivalent command in fedora pa_ash Linux - Software 0 06-28-2004 01:27 AM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration