how to shutdown ?

Need support for GhostBSD. Ask here if your question does not fit elsewhere.
Post Reply
stroudmw
Posts: 3
Joined: Thu Aug 01, 2019 6:47 am
Has thanked: 0
Been thanked: 1 time

how to shutdown ?

Post by stroudmw » Fri Aug 02, 2019 5:10 am

Hi,

I'm new to BSD, although I used Linux (DG/UX) back in the late 1980s, and have been using Linux (mostly Debian) for about 5 years.

I've just installed the latest (XFCE) version of GhostBSD. I've managed to install the Nvidia and Broadcomm drivers for this very old Dell Vostro 1719 laptop.

The main problem I've got right now is that the Shutdown and Restart buttons don't work: they just log me out. I need to go to the command prompt and type either

Code: Select all

sudo reboot
, or

Code: Select all

poweroff
(poweroff doesn't need "sudo").

What I have done so far:

I used visudo to include the line

Code: Select all

mike ALL=(ALL) NOPASSWD: /sbin/poweroff, /sbin/reboot, /sbin/shutdown
in my sudoers file, thinking that it might be a permissions problem.

I've made sure that I'm in the "wheel" group

I even included the line

Code: Select all

hw.usb.no_shutdown_wait=1
in my /etc/sysctl.conf file. That was grasping at straws, and was a solution that I found here in the forum. But it didn't work.

Vital statistics:

Code: Select all

System:    Host: stuka Kernel: 13.0-CURRENT amd64 (64 bit)
           Desktop: Xfce 4.12.4 OS: FreeBSD 13.0-CURRENT
Thank you.
These users thanked the author stroudmw for the post:
liam (Sun Aug 04, 2019 12:51 pm)
Rating: 50%

stroudmw
Posts: 3
Joined: Thu Aug 01, 2019 6:47 am
Has thanked: 0
Been thanked: 1 time

Re: how to shutdown ?

Post by stroudmw » Mon Aug 05, 2019 3:53 am

What I ended up doing was to create a fish shell script with "sudo poweroff" in it. I made it executable, and then created a shortcut to the desktop. So, I click on it to shutdown.

But there must be a more elegant solution...

aht0
Posts: 4
Joined: Thu Apr 25, 2019 1:25 pm
Has thanked: 0
Been thanked: 1 time

Re: how to shutdown ?

Post by aht0 » Thu Aug 15, 2019 5:29 am

One way.. Install doas (utility like sudo but derived from OpenBSD). IMHO more convenient to configure issuing such commands on user-level.

Then edit /usr/local/etc/doas.conf file. Nano or ee text editors are fine for it. Use vi if you happen to be comfortable with it. Doesn't matter much, which.

Add

Code: Select all

permit persist :wheel #assuming your user is in 'wheel' group 
permit nopass yourusername as root cmd reboot 
permit nopass yourusername as root cmd shutdown 
All there is to it.
These users thanked the author aht0 for the post:
ericbsd (Thu Aug 15, 2019 9:12 am)
Rating: 50%

stroudmw
Posts: 3
Joined: Thu Aug 01, 2019 6:47 am
Has thanked: 0
Been thanked: 1 time

Re: how to shutdown ?

Post by stroudmw » Thu Aug 15, 2019 8:15 am

Thanks for getting back to me. I'll give that a try!

User avatar
ericbsd
Developer
Posts: 1442
Joined: Mon Nov 19, 2012 7:54 pm
Has thanked: 39 times
Been thanked: 56 times

Re: how to shutdown ?

Post by ericbsd » Thu Aug 15, 2019 9:33 am

@stroudmw to fix you issue with the UI restart and shutdown do this in a terminal console.

Code: Select all

sh
for i in "/usr/local/lib/ConsoleKit/scripts/ck-"*; do sudo cp -v "${i}" "${i%.sample}"; done

dismas
Posts: 9
Joined: Mon Jan 14, 2019 9:17 am
Has thanked: 0
Been thanked: 0

Re: how to shutdown ?

Post by dismas » Mon Aug 26, 2019 7:09 am

Hello Eric,
I don't know scripting very much but the above seems to copy all files whose names begin with "ck-" and add a ".sample" extension.
But don't we need the opposite (i.e. make a copy of ck-*.sample removing the ".sample" extension) ?
Regards.
:arrow: Sorry for my bad English : I'm French

Post Reply