]> arthur.barton.de Git - netatalk.git/commitdiff
Replace Solaris initscript with SMF manifest
authorFrank Lahm <franklahm@googlemail.com>
Tue, 29 May 2012 08:31:32 +0000 (10:31 +0200)
committerFrank Lahm <franklahm@googlemail.com>
Tue, 29 May 2012 08:31:32 +0000 (10:31 +0200)
NEWS
distrib/initscripts/.gitignore
distrib/initscripts/Makefile.am
distrib/initscripts/netatalk.xml.tmpl [new file with mode: 0644]

diff --git a/NEWS b/NEWS
index 5a47f408981acb9fd0ffae366c203e74906d4776..e51ab83f8b8e85be66f3ac96dd9a50d8fd9077a5 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,7 @@
+Changes in 3.0 beta2
+====================
+* UPD: Solaris and friends: Replace initscript with SMF manifest
+
 Changes in 3.0 beta1
 ====================
 * UPD: afpd: Performance tuning of read/write AFP operations. New option
index 949e409accf40ef98e4060d897baf4c570f59e63..125825eb761984ba0e04cc68ba5af8a529a7a658 100644 (file)
@@ -10,5 +10,5 @@ rc.suse
 service.systemd
 netatalk
 netatalk.service
-.gitignore
+netatalk.xml
 *.o
index 0987865f8861586b2d58d7986ef16bc21c6ab50e..4b88ba9d39f6ac37bc4195ff89f0b9459fcb951a 100644 (file)
@@ -23,7 +23,8 @@ GENERATED_FILES = \
        rc.redhat \
        rc.solaris \
        rc.suse \
-       service.systemd
+       service.systemd \
+       netatalk.xml
 
 TEMPLATES = \
        rc.bsd.tmpl \
@@ -33,7 +34,8 @@ TEMPLATES = \
        rc.redhat.tmpl \
        rc.solaris.tmpl \
        rc.suse.tmpl \
-       service.systemd.tmpl
+       service.systemd.tmpl \
+       netatalk.xml.tmpl
 
 CLEANFILES = $(GENERATED_FILES) $(sysv_SCRIPTS) $(service_DATA) afpd cnid_metad
 EXTRA_DIST = $(TEMPLATES)
@@ -137,23 +139,14 @@ endif
 
 if USE_SOLARIS
 
-sysvdir = /etc/init.d
-sysv_SCRIPTS = netatalk
-
-$(sysv_SCRIPTS): rc.solaris
-       cp -f rc.solaris $@
-       chmod a+x $@
+servicedir = /lib/svc/manifest/network/
+service_DATA = netatalk.xml
 
 install-data-hook:
-       rm -f $(DESTDIR)/etc/rc2.d/S90$(sysv_SCRIPTS)
-       -ln -s ../init.d/$(sysv_SCRIPTS) $(DESTDIR)/etc/rc2.d/S90$(sysv_SCRIPTS)
-       rm -f $(DESTDIR)/etc/rc0.d/K04$(sysv_SCRIPTS)
-       -ln -s ../init.d/$(sysv_SCRIPTS) $(DESTDIR)/etc/rc0.d/K04$(sysv_SCRIPTS)
+       svccfg import netatalk.xml
 
 uninstall-startup:
-       rm -f $(DESTDIR)$(sysvdir)/$(sysv_SCRIPTS) \
-               $(DESTDIR)/etc/rc2.d/S90$(sysv_SCRIPTS) \
-               $(DESTDIR)/etc/rc0.d/K04$(sysv_SCRIPTS)
+       svccfg delete network/netatalk
 
 endif
 
diff --git a/distrib/initscripts/netatalk.xml.tmpl b/distrib/initscripts/netatalk.xml.tmpl
new file mode 100644 (file)
index 0000000..ce73954
--- /dev/null
@@ -0,0 +1,47 @@
+<?xml version="1.0"?>
+<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
+<service_bundle type="manifest" name="netatalk">
+
+    <service name="network/netatalk" type="service" version="1">
+
+        <create_default_instance enabled="true"/>
+        
+        <single_instance/>
+
+        <dependency name="network" grouping="require_all" restart_on="error" type="service">
+            <service_fmri value="svc:/milestone/network:default"/>
+        </dependency>
+
+        <dependency name="filesystem" grouping="require_all" restart_on="error" type="service">
+            <service_fmri value="svc:/system/filesystem/local"/>
+        </dependency>
+
+        <method_context>
+        </method_context>
+
+        <exec_method type="method" name="start" exec=":SBINDIR:/netatalk" timeout_seconds="60"/>
+
+        <exec_method type="method" name="stop" exec=":kill" timeout_seconds="60"/>
+
+        <property_group name="startd" type="framework">
+            <propval name="duration" type="astring" value="contract"/>
+            <propval name="ignore_error" type="astring" value="core,signal"/>
+        </property_group>
+
+        <property_group name="application" type="application">
+            <propval name="config_file" type="astring" value=":ETCDIR:/afp.conf"/>
+        </property_group>
+        
+        <stability value="Evolving"/>
+
+        <template>
+            <common_name>
+                <loctext xml:lang="C">
+                    Netatalk AFP Server
+                </loctext>
+            </common_name>
+        </template>
+
+    </service>
+
+</service_bundle>