Solved the 'command' service

MisterM

Verified User
Joined
Jul 31, 2022
Messages
224
Hello to all

I'm not going to hide it, I bought a dedicated server from ovh, I did the installation of the OS and after install, the "service" command not accessible but readable when you go in the /sbin/service directory

Does this make sense to you?

Mz
 

Richard G

Verified User
Joined
Jul 6, 2008
Messages
9,981
Location
Maastricht
No doesn't make sense. The service binary in /sbin/service should be chmod 755.

What OS distro and version?
 

Richard G

Verified User
Joined
Jul 6, 2008
Messages
9,981
Location
Maastricht
So what's the problem then. You say it's readable, but it shows it's executable.

If you issue the command
service exim status
what error do you get?
 

MisterM

Verified User
Joined
Jul 31, 2022
Messages
224
I will add a bit, a help if one day, someone has already had this problem.
I have added this to
/etc/environment
what I added
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games"
Now, service, adduser, useradd, all /sbin commands work.
Mz
 

Richard G

Verified User
Joined
Jul 6, 2008
Messages
9,981
Location
Maastricht
It can be used that way too indeed.
But it's a workaround. I'm wondering as to why it's maybe not in the path to begin with.

Try this command to see if you have a path if you encounter this issue again on a server:
echo $PATH

If it's empty, then the OS has missed it during install. Normally it's present in the /etc/profile file if I'm not mistaken.
So question is why the /etc/profile file is either missing or does not contain the path as should be.
 

Richard G

Verified User
Joined
Jul 6, 2008
Messages
9,981
Location
Maastricht
Might also be a Debian or OVH image issue, I'm not sure as I don't work with either.

But this thread is good to know like you said, also for people encountering the issue later on.
 

MisterM

Verified User
Joined
Jul 31, 2022
Messages
224
Of course, that's why I did it, because according to the instructions of their technical support, you are the master of your server
 
Top