[blfs-dev] 回复:Re: sddm-0.12.0

Bruce Dubbs bruce.dubbs at gmail.com
Mon Aug 17 19:39:43 PDT 2015


hykwok1 at sina.com wrote:
> Sddm checks two backends for power managment
(https://github.com/sddm/sddm/blob/master/src/daemon/PowerManager.cpp)
>
> UPOWER BACKEND  or LOGIN1 BACKEND
>
> That means we have to start upower before sddm otherwise no "power
off" and "reboot" buttons for the sddm greeter.
>

Thanks for that.

> {{{
>     start)
> 	log_info_msg "Starting udisksd..."
>          start_daemon /usr/libexec/udisks2/udisksd --replace --no-debug &
> 	evaluate_retval
> 	log_info_msg "Starting upowerd..."
>          pgrep -l upowerd || start_daemon /usr/libexec/upowerd &
> 	evaluate_retval
> 	log_info_msg "Starting SDDM..."
> 	start_daemon $BIN_FILE &
> 	evaluate_retval
> 	;;
> }}}

Tested as run level 5.

This works for me:

. /lib/lsb/init-functions

BIN_FILE="/usr/bin/sddm"

#$LastChangedBy: fernando $
#$Date: 2015-08-01 22:25:40 +0000 (Sat, 01 Aug 2015) $

case $1 in
    start)
         log_info_msg "Starting upowerd..."
         pgrep -l upowerd || start_daemon /usr/libexec/upowerd &
         evaluate_retval

         log_info_msg "Starting SDDM..."
         start_daemon $BIN_FILE &
         evaluate_retval
         ;;

    stop)
         log_info_msg "Stopping SDDM..."
         killproc $BIN_FILE

         log_info_msg "Stopping upowerd..."
         killproc upowerd
         evaluate_retval
         ;;

    restart)
         $0 stop
         sleep 2
         $0 start
         ;;

    status)
         statusproc ${BIN_FILE}
         statusproc /usr/libexec/upowerd
         ;;

    *)
         echo "usage: $0 [start|stop|restart|status]"
         exit 1
         ;;
esac

We don't really need 'pgrep -l upowerd'.  That function is included in 
start_daemon.

   -- Bruce


More information about the blfs-dev mailing list