Reboot command not working

In the past I have had a command to reboot the PC running the node. I gave it a four digit number that was not used. set it as this: “9876 = cmd,/sbin/reboot” and that has always worked. Now with this new version it does not. In fact I tried executing several commands that way and none worked. Has “cmd” been eliminated for some reason?

GeorgeC W2DB

George,
I think if you look in /sbin at the symlink file reboot

you will find it has ownership of root.
So, one way of working around that, if you so choose, is to change ownership to
asterisk:asterisk

But that is the issue at it’s core.

These privileges can be used inside /etc/asterisk/rpt.conf within the [functions] stanza as follows:

9001 = cmd,/etc/asterisk/scripts/asterisk-restart
9002 = cmd,/etc/asterisk/scripts/asterisk-stop
9003 = cmd,/etc/asterisk/scripts/allmon3-restart
9004 = cmd,/etc/asterisk/scripts/allmon3-stop
9005 = cmd,/usr/sbin/shutdown
9006 = cmd,/usr/sbin/reboot

This may help look in Manual Permissions

Martin
G8KOE

Well-documented in the manual:

I’ll give a try. The issue I suspect may be that /sbin/root is a link to /bin/system,ctl

This used to be real easy…

I’ll try changing ownership. I already tried to add asterisk to sudoers and did sudo /sbin/reboot, that didn’t work. And then tried adding asterisk to root users group, that didn’t work.

I have a situation at one site where sometimes internet port forwarding doesn’t work and I cannot ssh into the box. And also if the computer has a belly ache and need to reboot I need a way to do it from dtmf. This has happened once but very frustrating. The site visit requires coordinating with the site manager and may take several days…

GeorgeC W2DB

There is no need for any of that. Did you not read the link @N8EI posted?

Well tried that, didn’t work. changed the cmd line to cmd,/bin/systemctl reboot and that also didn’t work. All this after chown reboot and systemctl to asterisk.asterisk

Again, this worked great before ASL3…

I may just revert this back to earlier ASL.

GeorgeC

I see that he posted a link to some howto thing

and I had already done what he shows in the howto. No go.
GC

I see that those functions require v3.4, I have 3.2, how do I upgrade? Do I lose functions?
GC

Those commands do not reboot the computer. They restart asterisk.

No way to do this from command line?

/usr/sbin/reboot
But it does not fly from inside the command structure =cmd,
I am using 3.4 and the file is owned by root. Not going to execute from asterisk by command as presented.

It will from a command line if you are root. That has never been a issue needing a fix.

That is what he is after.
But I suppose anything that would force a full safe reboot would do.
I’m sure that works great from the command line as sudo/root.

9876 = cmd, /usr/sbin/reboot is the same issue. It is a root owned file.
The symlink is of /bin/systemctl

which, strange as it may be, systemctl is owned by asterisk:asterisk now.

That is not a fix. Or a good workaround.

But yes @George_Csahanin
the command line is
sudo /usr/sbin/reboot

That does not work for me because one system I have yet to convert to asl3, I have periodic network interruptions and need to reboot by dtmf from afar.
And I’m sure there are plenty of remote sites with that issue.

apt update
apt upgrade

Oh. I thought of that but figured it to be too obvious :slight_smile:
Thanks
G W2DB

Thanks Mike
I’m certain that I’m not the only one that needs this ability.

Is there a chance these commands “allowed” in v3.4 require an input signal to work? I did update and upgrade, now version 3.5. I added the 9001-9006 functions, use asterisk -r to make these functions happen, as in rpt fun 1999 *9006 (or 9001, 9002 I don’t use allmon) and exactly zero happens. Even the commands to kill asterisk or restart asterisk don’t work. To test things I wrote a script the echo text to a file in /etc/asterisk using 999=cmd,/etc/asterisk/test (the name of the script) and that does not work. Yet executing another command like *904 (test tone) from the CLI and it does work. cmd just doesn’t work and I need to get this running…

On another node I have version 1 of ASL running (node 2360) and I have cmd command for reboot there and it works fine. On 28599 it is running ACID and it too executes a cmd fine. I’m really stumped. I’m no newcomer to Linux by any means, dealing with it since 1994.

Also, sudo doesn’t work since asterisk isn’t in sudoers list. I did try adding that and still no good. Starting to think it is a bash issue though bash is rwxr-xr-x owned by root

This PC is on the bench and I have not the ability to connect to a repeater to test. That would be to confirm it needs if it only functions with an input signal but hoping the folks in here have some insight.

GeorgeC W2DB

I just rigged a receiver to the thing and looking at stats it is in fact decoding the commands however 9001-9006 as shown is the permissions howto do nothing but *721, for example, does play the ID. *904 does play a tone. Just seems the “cmd” isn’t working
GeorgeC

Do you still have the default macro 99 in the configuration? Those were just examples in the manual. Each leading number of DTMF calls for a macro (e.g. 9) needs to be the same length. If you have 99 and then 990n, that won’t work quite right.