Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Pages like this say that you can

service iptables restart

...but I get a command not found error. I tried yum install service but there's no such package.

How do I restart services?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

How about /sbin/service iptables restart ?

share|improve this answer
    
sudo in front of that worked. Thanks! –  Kev Dec 2 '10 at 17:51

"How To Become Root"

share|improve this answer
    
Good point. I'd sort of assumed he had become root with "/bin/su" not "/bin/su -", so lacked the PATH. If that's true, my answer is probably more immediately helpful, but yours is way better in the long run. –  MadHatter Dec 2 '10 at 17:26
    
I had tried sudo service iptables restart and gotten the same message. Sorry, I forgot to mention that. –  Kev Dec 2 '10 at 17:49
    
@Kev: Did you read the article? –  Ignacio Vazquez-Abrams Dec 2 '10 at 17:50
    
Ah, I see it does answer the question, in "The reason is that regular system users and the root user have different PATH environment variables (you can view a users PATH with 'echo $PATH')." However, the other answer got it working for me much quicker. :) (I still gave +1 to you...) –  Kev Dec 2 '10 at 17:52

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.