Link to home
Start Free TrialLog in
Avatar of Leigh Kalbli
Leigh Kalbli

asked on

linux commands

I am using a variant of blackfin linux.  I am new to it and reading so much documentation.  What is the command needed to reboot.?
Avatar of Peter Hutchison
Peter Hutchison
Flag of United Kingdom of Great Britain and Northern Ireland image

In most linux distributions, the command is 'shutdown' with the -r option to reboot, you also need to specify time before rebooting, specifying 'now' will cause a reboot immediately.
Avatar of Leigh Kalbli
Leigh Kalbli

ASKER

Thanks for the response. do you need to be under a specific directory?
User generated imagescreen shot added
On some linux distribution reboot command would also work.

POSIX style you could do init 6 which should also reboot the system.

more details here:
http://www.binarytides.com/linux-command-shutdown-reboot-restart-system/

Sudeep
Are you on a direct linux machine or accessing a VM using putty or something? I am just curious. Either way, in Linux the basic command from any directory would be "sudo poweroff" to shutdown or "sudo reboot" to restart it. Give that a go and let us know.
You should be able to issue either reboot or shutdown -r either one.

If these fail... then either you original installation had some sort of error or the command you're trying has been removed.

Also your $PATH variable may have been corrupted.

Try typing...

which sh

Open in new window


If this fails, you have some serious problems, if it works, then try running which for reboot + shutdown.

If this fails, try using the locate command for each command - reboot + shutdown.

Once you have the absolute path, you should be able to execute either, by absolute path.
some additional background. This is an embedded version on hardware that i didn not install that comes from a manufacture we are partnered with.  They are telling me it cannot be rebooted remotely but have to be local and unplug it but if i can SSH to it then i dont see why i have to be there to power cycle.

sudo cmds dont work.
User generated image
Have you tried just simply typing the word "reboot" and seeing what it does?
Tried reboot. Restart. Reset.  No dice.
The other command, which is listed in your screenshot, is 'halt', you can use the --reboot option with that to restart the system.
http://www.man7.org/linux/man-pages/man8/halt.8.html
Another thing, when typing commands is to specify the path to the command e.g. ./reboot (dot forward-slash) or /bin/reboot, rather than just reboot as the current folder is not included the command path, due to security reasons.
It look the the manufacture of the product (that we resell) has it locked down.

I have a username and pw but i think it only gives me specific access.
User generated image
Try running 'su' to enter super user mode and enter the root password, then run the reboot command again.
These commands need to be run as root, so you need to precede them with sudo or su, depending on the variant of linux that balckfin follows..
su - shutdown -r
sudo -i init 6
sudo -i reboot

You can't run them as a user.

With su, you need to enter the root user's password.
With sudo you need to enter the user's own password.
It may also be that the directory containing the shutdown and reboot executables simply isn't in the PATH environment variable of any user other than root.
Well, it looks like you will have to power cycle the device manually.
ASKER CERTIFIED SOLUTION
Avatar of serialband
serialband
Flag of Ukraine image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial