From: Matthew R. Trower Date: Mon, 18 Jun 2018 09:20:43 +0000 (-0500) Subject: Add SMF service on Sun X-Git-Tag: 2.3.0~11 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=db6de6284f3f2ad7e3f4156df7d31e98466e6c24;p=oweals%2Fcde.git Add SMF service on Sun --- diff --git a/cde/databases/CDE-RUN.udb b/cde/databases/CDE-RUN.udb index af4e2fc7..ffb43d8e 100644 --- a/cde/databases/CDE-RUN.udb +++ b/cde/databases/CDE-RUN.udb @@ -268,6 +268,12 @@ programs/dtconfig/sun/dtlogin.rc mode = 0555 } # +programs/dtconfig/sun/dtlogin.xml +{ sun + install_target = /usr/dt/config/dtlogin.xml + mode = 0555 +} +# programs/dtconfig/sun/dtconfig { sun install_target = /usr/dt/bin/dtconfig diff --git a/cde/programs/dtconfig/sun/dtconfig.src b/cde/programs/dtconfig/sun/dtconfig.src index 7e07b6f8..8956951a 100644 --- a/cde/programs/dtconfig/sun/dtconfig.src +++ b/cde/programs/dtconfig/sun/dtconfig.src @@ -69,6 +69,20 @@ fi RC_COPY=/etc/init.d/dtlogin +XCOMM +XCOMM Allow for configured and factory versions of dtlogin.xml +XCOMM + +if [ -f CDE_CONFIGURATION_TOP/config/dtlogin.xml ] +then + SVC_MASTER=CDE_CONFIGURATION_TOP/config/dtlogin.xml +elif [ -f CDE_INSTALLATION_TOP/config/dtlogin.xml ] +then + SVC_MASTER=CDE_INSTALLATION_TOP/config/dtlogin.xml +fi + +SVC_COPY=application/graphical-login/dtlogin + LEVEL_0_KILL=/etc/rc0.d/K10dtlogin LEVEL_1_KILL=/etc/rc1.d/K10dtlogin LEVEL_2_START=/etc/rc2.d/S99dtlogin @@ -399,12 +413,23 @@ XCOMM case "$mode" in '-d') - /usr/bin/rm -f $LEVEL_2_START + if [ -f /usr/sbin/svcadm ]; then + if svcs $SVC_COPY >/dev/null 2>&1; then + if ! svcadm disable $SVC_COPY >/dev/null; then + Message 12 "disable failed" + Message 13 "could not disable dtlogin service" "svc-dtlogin" + exit 1 + fi + fi + else - if [ -f $LEVEL_2_START ]; then - Message 12 "disable failed" - Message 13 "could not remove $LEVEL_2_START" $LEVEL_2_START - exit 1 + /usr/bin/rm -f $LEVEL_2_START + + if [ -f $LEVEL_2_START ]; then + Message 12 "disable failed" + Message 13 "could not remove $LEVEL_2_START" $LEVEL_2_START + exit 1 + fi fi Message 14 "done" @@ -412,42 +437,56 @@ case "$mode" in ;; '-e') - if [ -f $RC_MASTER ]; then + if [ -f /usr/sbin/svcadm ]; then + if ! svcs $SVC_COPY >/dev/null 2>&1; then + if ! svccfg import $SVC_MASTER; then + Message 16 "Enable Failed" + Message 17 "could not import $SVC_MASTER" $SVC_MASTER + exit 1 + fi + elif ! svcadm enable $SVC_COPY >/dev/null; then + Message 16 "enable failed" + Message 17 "could not enable dtlogin service" svc-dtlogin + exit 1 + fi + else + if [ -f $RC_MASTER ]; then /usr/bin/rm -f $RC_COPY - fi + fi - if [ ! -x $RC_COPY ]; then - if [ ! -f $RC_MASTER ]; then + if [ ! -x $RC_COPY ]; then + if [ ! -f $RC_MASTER ]; then Message 16 "enable failed" Message 17 "could not find $RC_MASTER" $RC_MASTER exit 1 - fi + fi - /usr/bin/cp $RC_MASTER $RC_COPY - /usr/bin/chmod 0555 $RC_COPY + /usr/bin/cp $RC_MASTER $RC_COPY + /usr/bin/chmod 0555 $RC_COPY - if [ ! -x $RC_COPY ]; then + if [ ! -x $RC_COPY ]; then Message 16 "enable failed" Message 18 "could not create $RC_COPY" $RC_COPY exit 1 - fi - fi + fi + fi - /usr/bin/rm -f $LEVEL_0_KILL - /usr/bin/ln $RC_COPY $LEVEL_0_KILL + /usr/bin/rm -f $LEVEL_0_KILL + /usr/bin/ln $RC_COPY $LEVEL_0_KILL - /usr/bin/rm -f $LEVEL_1_KILL - /usr/bin/ln $RC_COPY $LEVEL_1_KILL + /usr/bin/rm -f $LEVEL_1_KILL + /usr/bin/ln $RC_COPY $LEVEL_1_KILL - /usr/bin/rm -f $LEVEL_2_START - /usr/bin/ln $RC_COPY $LEVEL_2_START + /usr/bin/rm -f $LEVEL_2_START + /usr/bin/ln $RC_COPY $LEVEL_2_START - if [ ! -f $LEVEL_2_START ]; then - Message 16 "enable failed" - Message 19 "could not create $LEVEL_2_START" $LEVEL_2_START - exit 1 - fi + if [ ! -f $LEVEL_2_START ]; then + Message 16 "enable failed" + Message 19 "could not create $LEVEL_2_START" $LEVEL_2_START + exit 1 + fi + fi Message 14 "done" Message 20 "desktop auto-start enabled." ;; @@ -475,6 +514,10 @@ case "$mode" in ;; '-kill') + if [ -f /usr/sbin/svcadm ]; then + svcadm disable -t $SVC_COPY + fi + rc_master_check $RC_MASTER stop diff --git a/cde/programs/dtconfig/sun/dtlogin.xml b/cde/programs/dtconfig/sun/dtlogin.xml new file mode 100644 index 00000000..621a809c --- /dev/null +++ b/cde/programs/dtconfig/sun/dtlogin.xml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +