Quoth Bernard Biessy on Mon, Dec 11, 2006 at 02:27:27AM -0800: > I would like to use rsyncd manifest but I have some errors with the methods : > > When I want to enable the service, rsync is in maintenance state : > :svcadm -v enable svc:/network/rsync: > svc:/network/rsync:default enabled. > :svcs -a | grep rsync > maintenance Dec_08 svc:/network/rsync:default > : > > When I check with svcs, I see : > :svcs -xv > svc:/network/rsync:default (RSYNC daemon) > State: maintenance since Fri Dec 08 15:40:44 2006 > Reason: Method failed. > See: http://sun.com/msg/SMF-8000-8Q > See: man -M /usr/share/man -s 7 rsync > See: /var/svc/log/network-rsync:default.log > Impact: This service is not running.
svcs -x can distinguish failure of the start method, so since the reason isn't "Start method failed...", I suspect one of the other methods. > <!-- METHODS --> > <!-- start & stop methods are required, restart method is optional --> > > <exec_method type="method" name="start" exec="/usr/local/bin/rsync > --daemon > --config=/usr/local/etc/rsyncd.conf > --port=873" timeout_seconds="60"/> > > <exec_method type="method" name="stop" exec=":kill" > timeout_seconds="60"/> > > <exec_method type="method" name="refresh" exec=":kill -HUP" > timeout_seconds="60"/> These look ok. > <!-- SERVICE MODEL --> > <!-- It is a transient service - These are often configuration > services which require no long-running processes in order > to provide service. --> > <property_group name="startd" type="framework"> > <propval name="duration" type="astring" value="transient"/> > </property_group> Uh oh, why are you declaring the service to be transient? Your start method launches rsync with --daemon, so I assume it will spawn a long-running process. This would cause your stop method -- :kill -- to fail, which explains the "Reason: Method failed." message. :kill is illegal for transient services, because no processes are kept track of to kill. Quoth Bernard Biessy on Mon, Dec 11, 2006 at 06:37:17AM -0800: > I do : > :svcadm clear svc:/network/rsync:default > :svcadm restart svc:/network/rsync:default > :svcadm enable svc:/network/rsync:default > :svcs -a | grep rsync > online 15:21:41 svc:/network/rsync:default > : > :svcadm disable svc:/network/rsync:default > :svcs -a | grep rsync > maintenance 15:22:23 svc:/network/rsync:default > : This confirms it. There wasn't a problem bringing the service online -- the problem occurred when you disabled it. Since you declared the service to be transient, you should be able to find the process with ps or pgrep, but it svcs -p won't associate it with the service. > And in the log file, there is now : > > :tail -f /var/svc/log/network-rsync:default.log > ... > [ Dec 11 15:20:55 Leaving maintenance because clear requested. ] > [ Dec 11 15:20:55 Disabled. ] > [ Dec 11 15:21:41 Enabled. ] > [ Dec 11 15:21:41 Executing start method ("/usr/local/bin/rsync --daemon > > --config=/usr/local/etc/rsyncd.conf --port=873") ] > [ Dec 11 15:21:41 Method "start" exited with status 0 ] > [ Dec 11 15:22:23 Stopping because service disabled. ] > : Hmm, no useful error messages. Indeed, http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/svc/startd/method.c#709 shows that we log an error for this situation, but not to the service's log file. Check the console, /var/adm/messages, or /var/svc/log/svc.startd.log for ":kill with no contract". I'll file a bug to make svc.startd send an error message to the service's log file, too. David