LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 08-21-2006, 04:02 PM   #1
akuma_linux
Member
 
Registered: Aug 2006
Distribution: Ubuntu, CentOS
Posts: 31

Rep: Reputation: 15
'Service' Command issue - Fedora Core 5


Hi Everyone,

Can anyone help me please, i have just installed Fedora Core 5 and im a complete beginner. I have previously used Mandriva, albeit for a very short period of time.

In mandriva i used the command :

service httpd restart

to restart apache. In Fedora Core 5 however trying to run this command gives me the error :

bash: service: command not found

I have tried running this commmand as both my normal user and as root, but get the same error regardless of the user. Running the command :

/etc/rc.d/init.d/httpd restart

does work however, and so i am wondering how it is i can set this up so that i can restart apache just like i used to in Mandriva, is this possible?

I should also say that i havent yet modified any apache files (httpd.conf) or made any modifications to the system, basically just installed FC5 and have been trying to get familiar with it.

Thankyou for your time and patience, sorry if this topic/ subject has been posted before.

Last edited by akuma_linux; 08-21-2006 at 04:20 PM.
 
Old 08-21-2006, 04:27 PM   #2
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
The service command is installed as part of the initscripts package. Somehow you managed to delete it (it is always installed).
 
Old 08-21-2006, 05:04 PM   #3
akuma_linux
Member
 
Registered: Aug 2006
Distribution: Ubuntu, CentOS
Posts: 31

Original Poster
Rep: Reputation: 15
Hi

Thankyou for the reply. Im not sure how i could have removed this to be honest, however is there a way to resolve this which will not result in me having to reinstall Fedora?

Thanks
 
Old 08-21-2006, 05:22 PM   #4
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
Yes, simply re-install initscripts.

1. Check your current version:

rpm -q initscripts

2. Retrieve the file from either the base distribution, or if you've applied maintenance, from the update directory.

3. Replace the installed files:

rpm -Uvh --force initscripts-*.rpm
 
Old 08-22-2006, 07:37 AM   #5
akuma_linux
Member
 
Registered: Aug 2006
Distribution: Ubuntu, CentOS
Posts: 31

Original Poster
Rep: Reputation: 15
Thankyou very much macemoneta, i'll give that a try tonight.
 
Old 08-22-2006, 07:49 AM   #6
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 61
It seems likely that you did this as a normal user instead of root user. looks like this ....
Code:
$ service httpd restart
-bash: service: command not found
To become the root user, type: su - press the enter key and input the root password. then, you can run the service command.
For example
Code:
# service iptables restart
Flushing firewall rules:                                   [  OK  ]
Setting chains to policy ACCEPT: filter mangle nat         [  OK  ]
Unloading iptables modules:                                [  OK  ]
Applying iptables firewall rules:                          [  OK  ]
Loading additional iptables modules: ip_conntrack_netbios_n[  OK  ]
 
Old 08-23-2006, 07:45 AM   #7
akuma_linux
Member
 
Registered: Aug 2006
Distribution: Ubuntu, CentOS
Posts: 31

Original Poster
Rep: Reputation: 15
Hi homey,

I tried the command as root using su (i had also added my user to the sudoers file as well and tried the command using 'sudo service httpd restart') so i dont think this was the cause of the problem. Although i am new to linux this is one of the very few things i know how to do so far, however your reply is very much appreciated, thankyou.

I havent had a chance to try the advice given by macemoneta yet, but will reply once i have to confirm if it worked.

Thanks again
 
Old 08-23-2006, 09:04 AM   #8
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
If you are using su, remember the '-' option to get the target user's environment (make it a login shell). Otherwise, you are running with your PATH, instead of root's PATH, and the privileged commands will not be found (/sbin/ is not part of a normal user's command search PATH).
 
Old 08-24-2006, 06:04 AM   #9
akuma_linux
Member
 
Registered: Aug 2006
Distribution: Ubuntu, CentOS
Posts: 31

Original Poster
Rep: Reputation: 15
Hi homey, macemoneta,

su- has done the trick, and you've both taught me something new, thankyou :-)
 
  


Reply



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
issue with 'service' command vortmax Fedora 5 08-08-2006 01:26 PM
issue installing svnserve as xinetd service in Fedora lipidinc Linux - Software 1 03-05-2006 03:49 AM
Fedora Core 4 Issue Theoscion Linux - Distributions 1 02-04-2006 12:31 PM
Fedora Core issue drfinn Linux - General 6 09-24-2005 10:20 AM
how to start pop3 service in fedora core 3 and 2 using dovecot abhis_mail2002 Fedora 5 02-01-2005 04:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora

All times are GMT -5. The time now is 02:28 PM.

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