I've struggled with the issue of what to do about services failing to
start/stop/restart as well, and how hard AutomateIt should try to ensure
that these succeeded.
The "service_manager.restart" is effectively calling
"/etc/init.d/apache2 restart" on your system performs no other checks to
confirm that this succeeded. The exit values from init.d scripts aren't
standardized, so trying to guess what they mean is risky.
Would the following approach be more reasonable? Try to
start/stop/restart the service, and confirm it by checking for a certain
amount of time till it assumes it either successfully completes, or the
timeout is reached and an exception is thrown.
For example:
# Tell Apache to start and wait up to 30 seconds
# for it to start, else raise exception:
service_manager.start "apache", :confirm => 30
# Same but use some sensible default number of seconds:
service_manager.start "apache", :confirm => true
# Configure a default confirmation, like in the Project's
# "automateit_env.rb" file to provide a default value:
service_manager.setup(:confirm => 30)
# And then following start/stop/restart calls will confirm by default:
service_manager.start "apache"
# Unless you deliberately tell them not to:
service_manager.start "apache", :confirm => false
Thoughts?
-igal
> --
>
> You received this message because you are subscribed to the Google Groups "AutomateIt" group.
> To post to this group, send email to
autom...@googlegroups.com.
> To unsubscribe from this group, send email to
automateit+...@googlegroups.com.
> For more options, visit this group at
http://groups.google.com/group/automateit?hl=.
>
>
>