Upload
ratnadeep-bhattacharya
View
215
Download
0
Embed Size (px)
Citation preview
8/19/2019 4. Managing Services
1/3
Determining the system’s runlevel:
#who –r
Getting status report of a service:
#svcs -lp sendmail
Getting a status report on all services:
#svcs -a for smf controlled services
#inetadm for services controlled by inetd
Customizing a service or listing customisations:
#svccfg -s sendmail
#svccfg -s sendmail listcust
Dependency checking:
#svcs -D sendmail checks which service is dependent on sendmail
Determining which service instances are dependent on the multi-user
milestone:
#svcs -D multi-user
Determining the services a service instance is dependent on:
#svcs -d sendmail
Sending an email when transactions go to maintenance:
#svccfg setnotify -g maintenance mailto:[email protected]
Disabling a service:
#svcadm disable sendmail
he service can be disabled only when there are no dependent services.
nabling a service:
#svcadm enable sendmail
#svcadm enable –r sendmail enables re!uired dependencies
Starting a service
#svcs –d sendmail
8/19/2019 4. Managing Services
2/3
Displaying the status of a service:
#svcs -l sendmail
Check if a service is enabled:
#svcs -x sendmail
nabling a service in temp mode:
#svcadm enable -rt sendmail starts the service in temp mode. he service
won"t persist across a reboot
!estarting a service:
#svcadm restart sendmail
"isting #$Ds and service instances associated with a service %&his is
re'uired to check that all instances of a service that has enteredmaintenance mode are stopped(:
#svcs -p sendmail
)illing a service %for a service in maintenance(:
#pkill - sendmail
!estoring a service %for a service in maintenance or degraded state(:
#svcadm clear sendmail
S*+ #ro,les
$ pro%le is an &'( %le which lists multiple services and states whether each should
be enabled or disabled. )ro%les are useful when multiple services are re!uired to be
started and another group needs to shut down.
Creating a new pro,le as a backup of the old:
#svccfg export * pro%le.xml
Change name of the pro,le and change enabled .true’ or .false for each
service/
0pplying a pro,le:
#svccfg apply pro%le.xml
S* noti,cation for service state change
$nstall the S* package:
8/19/2019 4. Managing Services
3/3
#pkg install service+fault-management+smtp-notify
nable the service:
#svcadm enable smtp-notify
#ps –ef , grep smtp
Setting up noti,cation:
#svccfg –s svc:+system+svc+global:default setnotify –g from-online
mailto:root@localhost
his will enable noti%cation for all services.
nabling noti,cation for one service only:
#svccfg -s svc:+network+http:apache setnotify -g from-online
mailto:root@localhost
Checking noti,cation:
#svccfg -s svc:+system+svc+global:default listnotify
Deleting noti,cation:
#svccfg -s svc:+network+http:apache delnotify -g all
!efresh and restart of a service are typically re'uired when changing
con,guration/
mailto:root@localhostmailto:root@localhostmailto:root@localhostmailto:root@localhost