Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: graphical shutdown in command line needed

  1. #1
    Join Date
    Oct 2012
    Beans
    50

    graphical shutdown in command line needed

    Hi,
    I want to start the shutdown window from command line, like this:

    Code:
    $ sudo halt
    doesn't work correctly (because it couldn't DO), that's why I want to use this form.

    Thanks in advance for Your answers.

    Regards,
    m

    PS: Buttons are "Cancel" and "Shutdown" of course

  2. #2
    Join Date
    Oct 2008
    Location
    Ottawa, Canada
    Beans
    805
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: graphical shutdown in command line needed

    That's a dialog produced by the Xfce Session Menu a.k.a. Action Buttons plugin. I don't think you can directly call it from the command line.

    You can call the logout dialog with
    Code:
    xfce4-session-logout
    or shutdown directly (no confirmation) with
    Code:
    xfce4-session-logout --halt
    Cheers!
    husband@wife$ make sandwich
    Permission denied
    husband@wife$ sudo make sandwich

  3. #3
    Join Date
    Oct 2012
    Beans
    50

    Re: graphical shutdown in command line needed

    Quote Originally Posted by LewisTM View Post
    That's a dialog produced by the Xfce Session Menu a.k.a. Action Buttons plugin. I don't think you can directly call it from the command line.

    You can call the logout dialog with
    Code:
    xfce4-session-logout
    or shutdown directly (no confirmation) with
    Code:
    xfce4-session-logout --halt
    Cheers!
    This is the way. Thank You!

  4. #4
    Join Date
    Oct 2008
    Location
    Ottawa, Canada
    Beans
    805
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: graphical shutdown in command line needed

    Excellent! Please mark as SOLVED.
    husband@wife$ make sandwich
    Permission denied
    husband@wife$ sudo make sandwich

  5. #5
    Join Date
    Oct 2012
    Beans
    50

    Re: graphical shutdown in command line needed

    Quote Originally Posted by LewisTM View Post
    Excellent! Please mark as SOLVED.
    No! It's a really terrible OS.
    I WANT to halt automatically from command line without password! I WANT, because I NEED (I mean crontab and $ ... && sudo halt). It is also impossible still yesterday, because xfce4-session-logout --halt asks the password again. I hate it.
    I tried to edit sudoers AGAIN, but it doesn't work of course. No way.
    For example:
    Code:
    $ sudo visudo
    Code:
    User_Alias SHUTDOWNUSERS = user
    Cmnd_Alias SHUTDOWNCNMDS = /sbin/shutdown, /sbin/reboot, /sbin/halt
    SHUTDOWNUSERS SHUTDOWNCMNDS = NOPASSWD: SHUTDOWNCMNDS
    <esc>:wq
    visudo: Warning: Host_Alias `SHUTDOWNCMNDS' referenced but not defined
    BUT THERE IS NOT DEFINED OR REFERENCED ANY Host_Alias! I HAVE GOT User_Alias and Cmnd_Alias ONLY.
    Of course I tried any other way using something like this:
    Code:
    user ALL=(ALL:ALL) NOPASSWD: ALL
    It asks passwd any way.
    Can I get help?

  6. #6
    Join Date
    Sep 2006
    Beans
    7,909
    Distro
    Lubuntu Development Release

    typo

    You seem to have a typographical error. 'SHUTDOWNCNMDS' should be 'SHUTDOWNCMNDS'
    The Truth Shall Make Ye Fret.

  7. #7
    Join Date
    Oct 2012
    Beans
    50

    Re: typo

    Quote Originally Posted by Lars Noodén View Post
    You seem to have a typographical error. 'SHUTDOWNCNMDS' should be 'SHUTDOWNCMNDS'
    No. I've typed here, not copied from sudoers. It is correct there.

  8. #8
    Join Date
    Sep 2006
    Beans
    7,909
    Distro
    Lubuntu Development Release

    host alias specification

    Sorry I missed it the first time around "SHUTDOWNUSERS SHUTDOWNCMNDS = NOPASSWD: SHUTDOWNCMNDS" should be "SHUTDOWNUSERS all = NOPASSWD: SHUTDOWNCMNDS". That position / field is for the host name and you have no host alias specification covering "SHUTDOWNCMNDS".
    The Truth Shall Make Ye Fret.

  9. #9
    Join Date
    Feb 2012
    Location
    el_GR
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: graphical shutdown in command line needed

    Quote Originally Posted by madnbri View Post
    I WANT to halt automatically from command line without password!
    Have yout tried this ? => http://ubuntuforums.org/showpost.php...89&postcount=3

    Thanks

  10. #10
    Join Date
    Oct 2012
    Beans
    50

    Re: host alias specification

    Quote Originally Posted by Lars Noodén View Post
    Sorry I missed it the first time around "SHUTDOWNUSERS SHUTDOWNCMNDS = NOPASSWD: SHUTDOWNCMNDS" should be "SHUTDOWNUSERS all = NOPASSWD: SHUTDOWNCMNDS". That position / field is for the host name and you have no host alias specification covering "SHUTDOWNCMNDS".
    OK, I've corrected the Host_Alias mistake, but still doesn't work. sudo halt asks password.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •