UBports Robot Logo UBports Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Reboot from terminal?

    Scheduled Pinned Locked Moved Support
    3 Posts 2 Posters 988 Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
      Reply
      • Reply as topic
      Log in to reply
      This topic has been deleted. Only users with topic management privileges can see it.
      • G Offline
        Grisen
        last edited by

        How do I reboot my phone from the terminal, without having to type the password? I have a cron-job running to check connectivity, and I would like the script to able to boot the phone under certain circumstances. I tried adding: Cmnd_Alias SHUTDOWN_CMDS = /sbin/poweroff, /sbin/shutdown, /sbin/reboot & phablet ALL=(ALL) NOPASSWD: SHUTDOWN_CMDS with visudo after remounting / as rw, but it still prompts me. Any ideas?

        Regards

        Grisen

        1 Reply Last reply Reply Quote 0
        • T Offline
          tupp
          last edited by

          In my terminal, "sudo reboot" works. Does "reboot" or "sudo reboot" work in your cron job?

          1 Reply Last reply Reply Quote 0
          • G Offline
            Grisen
            last edited by

            Well "sudo reboot" works, but it prompts me for the password. I tried adding the job to sudo's crontab, but that doesn't work. The solution I described in post 1 works on a desktop ubuntu. After doing what I described, "sudo reboot" reboots the machine without prompting for password.

            Regards

            Grisen

            1 Reply Last reply Reply Quote 0

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            • First post
              Last post