You are not logged in.

#1 2010-08-30 00:18:14

pWneD
Member
Registered: 2010-08-30
Posts: 15

[SOLVED]Commands stopped working

Hi guys,

Some commands like reboot, export and daemon launchers stopped working on my system.
I can't sudo them and the usual "su" doesn't work neither. The only way to make them work is by doing "su -".

Any ideas on what's wrong?

Thanks

Last edited by pWneD (2010-08-30 15:04:24)

Offline

#2 2010-08-30 00:23:20

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED]Commands stopped working

I don't have a crystal ball, so posting errors if there are any in your logs would help a bit. What happens if you type 'reboot'?
Post you visudo.

What DE/WM are you running? What apps have you installed / updated?

Last edited by karol (2010-08-30 00:24:42)

Offline

#3 2010-08-30 00:27:06

pWneD
Member
Registered: 2010-08-30
Posts: 15

Re: [SOLVED]Commands stopped working

When I type "reboot" it just says that there is no such command ( same goes for "export"... ). Everything was working fine before I did an update this afternoon that included a new kernel and nvidia drivers. Unfortunately I can't post my visudo because I'm not on my workstation at this moment.

I'm using Openbox ( solo, not with Gnome nor KDE ) and, I don't know if it's relevant, but I'm using the "fish" shell.

Last edited by pWneD (2010-08-30 00:28:46)

Offline

#4 2010-08-30 01:10:55

stqn
Member
Registered: 2010-03-19
Posts: 1,191
Website

Re: [SOLVED]Commands stopped working

What is your $PATH variable like? If /sbin isn't in it, that would explain why reboot isn't found.

Is your root user also using the fish shell? If root is using bash, maybe that's why things work when run as root...

"export" is, I think, an internal shell command (at least I don't have any "export" in my path), so it's weird that it's not found.

(Note: I don't know anything about fish nor how to solve your problem.)

Offline

#5 2010-08-30 01:12:38

BaconPie
Member
Registered: 2010-08-11
Posts: 209

Re: [SOLVED]Commands stopped working

Run these and post the output:

$ echo $PATH
$ ls -l /sbin | grep reboot

Offline

#6 2010-08-30 03:31:59

Proofrific
Member
Registered: 2008-01-05
Posts: 215

Re: [SOLVED]Commands stopped working

As other said, it might be your path. Also, have you tried bash or a different shell?

Offline

#7 2010-08-30 13:21:04

pWneD
Member
Registered: 2010-08-30
Posts: 15

Re: [SOLVED]Commands stopped working

@karol
I just found out that visudo doesn't work ( same error ).

@BaconPie

Standart Account wrote:

/bin /usr/bin /usr/local/bin
lrwxrwxrwx 1 root root      4 May  1  2009 reboot -> halt*

Root Account using su - wrote:

/bin:/usr/bin:/sbin:/usr/sbin:/opt/java/jre/bin:/usr/lib/perl5/core_perl/bin
lrwxrwxrwx 1 root root      4 May  1  2009 reboot -> halt

The path's are different for some reasons, I didn't touch them.

@Proofrific
If I call bash from inside fish the result is the same, if I use the "su" command bash is used ( root is using the defaults ) and the result is the same, when I use "su -" it uses bash as well and the commands work.

Offline

#8 2010-08-30 13:29:14

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED]Commands stopped working

The paths should be different.
/etc/sudoers is the file I'm interested in.

Offline

#9 2010-08-30 13:33:00

pWneD
Member
Registered: 2010-08-30
Posts: 15

Re: [SOLVED]Commands stopped working

Here's the /etc/sudoers

## sudoers file.
##
## This file MUST be edited with the 'visudo' command as root.
## Failure to use 'visudo' may result in syntax or file permission errors
## that prevent sudo from running.
##
## See the sudoers man page for the details on how to write a sudoers file.
##

##
## Host alias specification
##
## Groups of machines. These may include host names (optionally with wildcards),
## IP addresses, network numbers or netgroups.
# Host_Alias    WEBSERVERS = www1, www2, www3

##
## User alias specification
##
## Groups of users.  These may consist of user names, uids, Unix groups,
## or netgroups.
# User_Alias    ADMINS = millert, dowdy, mikef

##
## Cmnd alias specification
##
## Groups of commands.  Often used to group related commands together.
# Cmnd_Alias    PROCESSES = /usr/bin/nice, /bin/kill, /usr/bin/renice, \
#                 /usr/bin/pkill, /usr/bin/top

##
## Defaults specification
##
## You may wish to keep some of the following environment variables
## when running commands via sudo.
##
## Locale settings

# Defaults env_keep += "LANG LANGUAGE LINGUAS LC_* _XKB_CHARSET"
##
## Run X applications through sudo; HOME is used to find the
## .Xauthority file.  Note that other programs use HOME to find   
## configuration files and this may lead to privilege escalation!
# Defaults env_keep += "HOME"
##
## X11 resource path settings
# Defaults env_keep += "XAPPLRESDIR XFILESEARCHPATH XUSERFILESEARCHPATH"
##
## Desktop path settings
# Defaults env_keep += "QTDIR KDEDIR"
##
## Allow sudo-run commands to inherit the callers' ConsoleKit session
# Defaults env_keep += "XDG_SESSION_COOKIE"
##
## Uncomment to enable special input methods.  Care should be taken as
## this may allow users to subvert the command being run via sudo.
# Defaults env_keep += "XMODIFIERS GTK_IM_MODULE QT_IM_MODULE QT_IM_SWITCHER"
##
## Uncomment to enable logging of a command's output, except for
## sudoreplay and reboot.  Use sudoreplay to play back logged sessions.
# Defaults log_output
# Defaults!/usr/bin/sudoreplay !log_output
# Defaults!/usr/local/bin/sudoreplay !log_output
# Defaults!/sbin/reboot !log_output

##
## Runas alias specification
##

##
## User privilege specification
##
root ALL=(ALL) ALL

## Uncomment to allow members of group wheel to execute any command
%wheel ALL=(ALL) ALL

## Same thing without a password
# %wheel ALL=(ALL) NOPASSWD: ALL

## Uncomment to allow members of group sudo to execute any command
# %sudo    ALL=(ALL) ALL

## Uncomment to allow any user to run sudo if they know the password
## of the user they are running the command as (root by default).
# Defaults targetpw  # Ask for the password of the target user
# ALL ALL=(ALL) ALL  # WARNING: only use this together with 'Defaults targetpw'

## Read drop-in files from /etc/sudoers.d (the # here does not mean a comment)
#includedir /etc/sudoers.d

Last edited by pWneD (2010-08-30 13:33:33)

Offline

#10 2010-08-30 13:42:02

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED]Commands stopped working

Did you type the paths it without the colons or that's the way your $PATH is now? If the latter, try to export it to look like this:

/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin

Offline

#11 2010-08-30 13:46:27

pWneD
Member
Registered: 2010-08-30
Posts: 15

Re: [SOLVED]Commands stopped working

No, I didn't change anything, the $PATH is like that with spaces and not colons.
How can I make it like that? Because I can't use the "export" command on my account, and if I use it on the root account wouldn't it replace the root's $PATH and not mine?

Offline

#12 2010-08-30 13:53:39

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED]Commands stopped working

pWneD wrote:

No, I didn't change anything, the $PATH is like that with spaces and not colons.
How can I make it like that? Because I can't use the "export" command on my account, and if I use it on the root account wouldn't it replace the root's $PATH and not mine?

Maybe putting it in your .bashrc will do the trick.

Offline

#13 2010-08-30 14:06:27

pWneD
Member
Registered: 2010-08-30
Posts: 15

Re: [SOLVED]Commands stopped working

Ok, I think it worked. I added "/sbin:/usr/sbin" to the .bashrc and now the $PATH looks like this:

/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin

So, I guess that if I had a similar thing to the .fish config file I would get the same result, right?
Is there a way to edit the file in which the actual $PATH is? ( to make it default ).

Btw, I just found out that the path was not separated with commas because of the fish shell. It's supposed to look more "friendly".

Last edited by pWneD (2010-08-30 14:10:03)

Offline

#14 2010-08-30 14:13:52

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED]Commands stopped working

Exporting it from .bashrc is safe. 'env' will print all your environmental variables, but where does it get them from - I don't know. Maybe you can set it just like you set default shell for the user.

Last edited by karol (2010-08-30 14:14:53)

Offline

#15 2010-08-30 14:16:23

pWneD
Member
Registered: 2010-08-30
Posts: 15

Re: [SOLVED]Commands stopped working

Alright, thank you very much for your help guys!
If anyone is wondering, to set the $PATH in the fish shell you have to:

set PATH[#] /path

# is the position in which you want to put the "/path".

Offline

Board footer

Powered by FluxBB