我正在尝试将x11vnc添加为SMF服务,但无法启动服务。我尝试使用谷歌搜索,但找不到任何可以帮助我的东西。
这是启动脚本
#!/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
这是清单文件
<?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>
和日志文件
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 ]
任何想法?
答案 0 :(得分:2)
你错过了传递&#34;开始&#34;参数:
<exec_method name='start' type='method' exec='/lib/svc/method/x11vnc start' timeout_seconds='0'>