A periodic or scheduled service runs its start method on a cadence or at a time that you specify by setting property values of the service.
The following command lists all periodic and scheduled services on the system because it lists all instances whose restarter is the periodic-restarter service:
$ svcs -R svc:/system/svc/periodic-restarter:default
You could also use svcs -l, svcprop, or svccfg to show the value of the general/restarter property.
The following command shows whether the instance is a periodic service or a scheduled service. A periodic service has a periodic property group, and a scheduled service has a scheduled property group:
$ svcprop -p periodic -p scheduled FMRI
If FMRI is a periodic service, the values of the periodic/period property and any other periodic properties that are set are shown. An error message is shown for the scheduled property group.
If FMRI is a scheduled service, the values of the scheduled/interval and scheduled/frequency properties and any other scheduled properties that are set are shown. An error message is shown for the periodic property group.
Properties that have no value are not shown by the svcprop or svccfg listprop commands. Use the following references to decide which properties to set to achieve the schedule you want:
For periodic services, see Specifying the periodic_method Element in Developing System Services in Oracle Solaris 11.3 and Scheduling Executions of a Periodic Service Start Method in Developing System Services in Oracle Solaris 11.3. Only the periodic/period property is required to schedule a periodic service. Other properties are optional.
For scheduled services, see Specifying the scheduled_method Element in Developing System Services in Oracle Solaris 11.3 and Scheduling Executions of a Scheduled Service Start Method in Developing System Services in Oracle Solaris 11.3. The scheduled/interval and scheduled/frequency properties are required to schedule a scheduled service.
If you set a property that has not been set before, you must specify the property type as shown in Example 21, Setting a Value that Contains a Colon Character. If you reset that property value, you do not need to specify the property type again. Also, if you set a property that has not been set before, you will see the following message:
Type required for new properties.
Use the svcadm or svccfg command to refresh the service instance. Use the svcprop command again to verify that the periodic or scheduled property values are updated.
The instance might have been disabled while you were modifying property values, or the instance might have gone into maintenance when you performed the refresh. If the instance is in maintenance, view the log file as described in Viewing Service Log Files. Possible problems include the following:
Conflicting properties are set. For example, you cannot set both the scheduled/day_of_month and scheduled/day property values.
Not all required properties are set. For example, you cannot set just the day and minute, you must also set the hour.
For more information about moving a service out of the maintenance state, see How to Repair an Instance That Is in Maintenance.
The following command shows the next time the service will run:
$ svcs -o nrun FMRI
If no schedule is shown, make sure the instance is online.
The following command shows that the compliance assessment service is currently scheduled to run once each week:
$ svcprop -p scheduled compliance:default scheduled/frequency integer 1 scheduled/interval astring week
With this schedule, the instance can run at any time on any day the first week. Subsequent runs will then occur some time that same day in future weeks.
The following commands set the instance to invoke its start method some time between 3am and 4am every Wednesday:
$ svccfg -s compliance:default svc:/application/security/compliance:default> setprop scheduled/day=Wednesday Type required for new properties. svc:/application/security/compliance:default> setprop scheduled/day = astring: Wednesday svc:/application/security/compliance:default> setprop scheduled/hour = integer: 3 svc:/application/security/compliance:default> refresh svc:/application/security/compliance:default> exit $ svcs compliance:default STATE STIME FMRI online 13:16:57 svc:/application/security/compliance:default $ svcs -o nrun compliance:default NRUN 3:27:16