More SMF

Inspired by my success in getting Squid into the Service Management Framework for Solaris 10, I have also now managed to hack something together for Samba.

The script used to kick off and kill the samba daemons is here. This should be copied to a suitable system location - I chose the default service methods directory: /lib/svc/method/.

The service bundle file is here. You could save this to the system services directory: /var/svc/manifest/network, but I chose just to keep it in my homedir as I am only experimenting with it. I guess if you plan to use LiveUpgrade in the future, it might be worthwhile copying this file over as I'm not sure how or whether the services database is rebuilt during Live Upgrade.

The service bundle is loaded into the SMF using the command:

# svccfg validate samba.xml
# svccfg import samba.xml

Note that I have marked it as disabled by default. To enable it, run:

# svcadm enable network/samba

That was easy, wasn't it ?

Comments:

Hmm, you should probably execute "/usr/sfw/sbin/smbd -D && /usr/sfw/sbin/nmbd -D" so if smbd fail you would stop and return error.

Posted by Iouri Goussev on February 17, 2005 at 12:33 AM GMT #

Very useful post, thanks!
FYI: there's a typo in the second svccfg line: "scvcfg".
Dmitri

Posted by trembovetski on March 18, 2005 at 06:18 PM GMT #

Don't forget to disable the old startup scripts in /etc/rc?.d
for FILE in `ls /etc/rc?.d/\*samba`; 
  do mv $FILE `dirname $FILE`/_`basename $FILE`;
done
David

Posted by David Bryant on January 14, 2007 at 01:08 PM GMT #

Post a Comment:
Comments are closed for this entry.
About

tdw

Search

Top Tags
Archives
« April 2014
MonTueWedThuFriSatSun
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
    
       
Today