hi. i would like to be able to reboot the system from my extension. is that possible? if yes, how? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20170406/55c7bee2/attachment.html>
On Thu, Apr 06, 2017 at 08:16:34PM +0300, Atux Atux wrote:> hi. i would like to be able to reboot the system from my extension. is that > possible? if yes, how?System('sudo /sbin/reboot') You need to allow that in a sudoers file, of course. This may or may not be a good idea. There are a host of other methods to permit unplivilidged users / processes to run do specific priviliged actions. -- Tzafrir Cohen +972-50-7952406 mailto:tzafrir.cohen at xorcom.com http://www.xorcom.com
Could you give some more details please? ???? 6 ??? 2017 8:25 ?.?., ? ??????? "Tzafrir Cohen" < tzafrir.cohen at xorcom.com> ??????:> On Thu, Apr 06, 2017 at 08:16:34PM +0300, Atux Atux wrote: > > hi. i would like to be able to reboot the system from my extension. is > that > > possible? if yes, how? > > System('sudo /sbin/reboot') > > You need to allow that in a sudoers file, of course. This may or may not > be a good idea. > > There are a host of other methods to permit unplivilidged users / > processes to run do specific priviliged actions. > > -- > Tzafrir Cohen > +972-50-7952406 mailto:tzafrir.cohen at xorcom.com > http://www.xorcom.com > > -- > _____________________________________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > Check out the new Asterisk community forum at: https://community.asterisk. > org/ > > New to Asterisk? Start here: > https://wiki.asterisk.org/wiki/display/AST/Getting+Started > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20170406/113b9672/attachment.html>
J Montoya or A J Stiles
2017-Apr-07 08:24 UTC
[asterisk-users] restart system from extension
On Thursday 06 Apr 2017, Atux Atux wrote:> hi. i would like to be able to reboot the system from my extension. is that > possible? if yes, how?It's possible, with something this in extensions.conf; exten => 999999,1,NoOp(Restarting server now) exten => 999999,n,System(shutdown -r now) Then dial 999999. NB this is UNTESTED, for obvious reasons! You probably do not want this extension to be in a context that anyone besides you can access. And if you are not running Asterisk as root, then you will need to write a C wrapper around the shutdown binary and make it setuid root. But just because it is possible, does not mean it is not a really, really terrible idea. The real question is, WHY are you wanting to be able to reboot your server from your extension? Because there is almost certainly a better way of achieving whatever it is that you are hoping to achieve. -- JM or AJS Note: Originating address only accepts e-mail from list! If replying off- list, change address to asterisk1list at earthshod dot co dot uk .