LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   service xinetd restart doesn't work on gentoo (https://www.linuxquestions.org/questions/linux-software-2/service-xinetd-restart-doesnt-work-on-gentoo-900373/)

Majed17 08-31-2011 03:47 AM

service xinetd restart doesn't work on gentoo
 
Hello, when i type as root
Code:

service xinetd restart
i get (on gentoo) -bash: service: command not found
but when i type:
Code:

/etc/init.d/xinetd restart
it works and gives the following output:
* Caching service dependencies ... [ ok ]
* Stopping xinetd ... [ ok ]
* Starting xinetd ... [ ok ]
knowing that i emerged xinetd and the first command works on another gentoo machine, its not of a big deal but i was just wondering why it is not working?

kbp 08-31-2011 04:57 AM

Maybe you became root without including root's environment, so $PATH may not have included /sbin. Make sure you don't forget the dash: 'su -' or 'sudo su -'

Majed17 08-31-2011 05:51 AM

didn't work
 
no i am already logged in as root but i still tried
Code:

su - root
but still the same.
Code:

echo $PATH
]produces the following: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/4.4.5
and xinetd is present in /usr/sbin which is included in the path and this is what is bewildering...
anyway thanks for trying to help, any other ideas?

kbp 08-31-2011 06:10 AM

The 'service' command is part of the initscripts package and should be located under /sbin. Does it exist ?

Majed17 08-31-2011 07:08 AM

thanks for the idea
 
actually it didn't come to my mind that the problem is with service command, it seems that in gentoo it doesn't exist. the other server it has the service file in it but it is redhat and not gentoo. So i read in a gentoo forum that a work around is to create a file called service in /usr/sbin and put the following in its content:
#!/bin/sh
runscript /etc/init.d/$1 $2
and then
Code:

chmod +x service
but i did that and now i get:
runscript should not be run directly
anything can be done further?

edit: grammar mistakes

Majed17 08-31-2011 07:59 AM

solved
 
for some reason i was typing in the end the command reversed i.e.
Code:

service restart xinetd
instead of
Code:

service xinetd restart
and it is working fine. and very much thanks for the clue about the service command, it will help me in future problems :)

knspradeep 10-25-2013 08:26 AM

Hey when I tried the same command the following error what should i want to do

/etc/init.d/xinetd: line 39: /etc/init.d/functions: No such file or directory
* ERROR: xinetd failed to start

Regards,
Pradeep

Majed17 10-25-2013 10:27 AM

What command did you try? the one with the dollar signs?


All times are GMT -5. The time now is 08:06 AM.