Adding x11vnc as a Solaris SMF service

Posted by rojanu on Stack Overflow See other posts from Stack Overflow or by rojanu
Published on 2011-11-16T18:55:58Z Indexed on 2011/11/18 1:50 UTC
Read the original article Hit count: 249

Filed under:
|
|

I am trying add x11vnc as SMF service but cannot get service to start. I tried googling but couldn't find anything that could help me.

Here is the startup script

#!/sbin/sh
#
# Copyright (c) 1995, 1997-1999 by Sun Microsystems, Inc.
# All rights reserved.
#
#ident  "@(#)x11vnc    1.14    06/11/17 SMI"

case "$1" in
'start')
    #/usr/local/bin/x11vnc -geometry 1280x1024 -noshm -display :0 -ncache 10 -noshm -shared -forever -o /tmp/vnc_remote.log -bg
    /usr/local/bin/x11vnc -unixpw -ncache 10 -display :0 -noshm -shared -forever -o /tmp/vnc_remote.log
    ;;

'stop')
        /usr/bin/pkill -x -u 0 x11vnc
    ;;

*)
    echo "Usage: $0 { start | stop }"
    ;;
esac
exit 0

and here is the manifest file

<?xml version='1.0'?>
<!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'>
<service_bundle type='manifest' name='vnc'>
  <service name='application/x11vnc' type='service' version='0'>
    <create_default_instance enabled='true'/>
    <single_instance/>
    <dependency name='docusp' grouping='require_all' restart_on='none' type='service'>
      <service_fmri value='svc:/milestone/multi-user-server:default'/>
    </dependency>
    <exec_method name='start' type='method' exec='/lib/svc/method/x11vnc' timeout_seconds='0'>
      <method_context/>
    </exec_method>
    <exec_method name='stop' type='method' exec=':true' timeout_seconds='10'>
      <method_context/>
    </exec_method>
    <stability value='Evolving' />
    <property_group name='startd' type='framework'>
      <propval name='ignore_error' type='astring' value='core,signal'/>
    </property_group>
  </service>
</service_bundle>

and the log file

Usage: /lib/svc/method/x11vnc { start | stop }
[ Nov 16 19:35:52 Method "start" exited with status 0 ]
[ Nov 16 19:35:52 Stopping because all processes in service exited. ]
[ Nov 16 19:35:52 Executing stop method (:kill) ]
[ Nov 16 19:35:52 Executing start method ("/lib/svc/method/x11vnc") ]
Usage: /lib/svc/method/x11vnc { start | stop }
[ Nov 16 19:35:52 Method "start" exited with status 0 ]
[ Nov 16 19:35:52 Stopping because all processes in service exited. ]
[ Nov 16 19:35:52 Executing stop method (:kill) ]
[ Nov 16 19:35:52 Executing start method ("/lib/svc/method/x11vnc") ]
Usage: /lib/svc/method/x11vnc { start | stop }
[ Nov 16 19:35:52 Method "start" exited with status 0 ]
[ Nov 16 19:35:52 Stopping because all processes in service exited. ]
[ Nov 16 19:35:52 Executing stop method (:kill) ]
[ Nov 16 19:35:52 Restarting too quickly, changing state to maintenance ]

Any Ideas?

© Stack Overflow or respective owner

Related posts about solaris

Related posts about vnc