You can use svcprop(1) for that:

e.g.
        # svcadm disable -t svc:/system/cron:default
        # svcprop -p general_ovr/enabled svc:/system/cron:default 2>/dev/null
        false
        # svcadm enable -t svc:/system/cron:default
        # svcprop -p general_ovr/enabled svc:/system/cron:default 2>/dev/null
        true
        # svcadm enable svc:/system/cron:default
        # svcprop -p general_ovr/enabled svc:/system/cron:default 2>/dev/null
        #

svcprop returns 'false' if the service is temporary disabled and
'true' if the service is temporary enabled; otherwise it returns nothing.

-- Renaud


Gavin McNay wrote:
> Is there any way to detect all the temporary changes that have been made to a 
> system? -- I asked this at Liane's tutorial at SANE 2006
> 
> I think I can get all the temporary disabled ones using
> 
> svcs |grep disabled
> 
> but this doesn';t account for the temporary enabled services though..
> 
> The following snippet seems to do the job
> 
> #!/bin/perl
> open (LS_SVCS, "svcs -a|");
> @svcs = grep {! /^lrc/ } map {/(\S+)$/} <LS_SVCS>;
> close (LS_SVCS) ;
> foreach my $s (@svcs) {
>         next if($s eq 'FMRI');
>         my $stat = `svcs -l $s`;
>         print $stat . "\n" if($stat =~ /enabled\s*.*temporary/);
> }
> 
> But a more builtin way of listing the temporary changes would be desirable I 
> think.
> 
> Gavin
>  
>  
> This message posted from opensolaris.org
> _______________________________________________
> smf-discuss mailing list
> smf-discuss at opensolaris.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: renaud.manus.vcf
Type: text/x-vcard
Size: 228 bytes
Desc: not available
URL: 
<http://mail.opensolaris.org/pipermail/smf-discuss/attachments/20060601/0733f4f5/attachment.vcf>

Reply via email to