summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2013-07-19 02:50:47 +0400
committerIgor Pashev <pashev.igor@gmail.com>2013-07-19 02:50:47 +0400
commit562684b97884396e37f5150736a61112f3fe0d9c (patch)
tree6b14ed9d8251a0783ecff21cc60e1c943d912715
parentc367bc013091f9e6757148dfe1b7e5f9e5a30184 (diff)
downloadlighttpd-562684b97884396e37f5150736a61112f3fe0d9c.tar.gz
Added SMF service
-rw-r--r--debian/changelog5
-rw-r--r--debian/lighttpd.smf/manifest/network/lighttpd.xml34
-rw-r--r--debian/lighttpd.smf/method/lighttpd26
3 files changed, 63 insertions, 2 deletions
diff --git a/debian/changelog b/debian/changelog
index 03cdb20..ed8a199 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-lighttpd (1.4.32-1+dyson1) UNRELEASED; urgency=low
+lighttpd (1.4.32-1+dyson1) unstable; urgency=low
[ Arno Töll ]
* Drop the connection-dos.patch - merged upstream.
@@ -10,11 +10,12 @@ lighttpd (1.4.32-1+dyson1) UNRELEASED; urgency=low
8.1 so we had to push the debhelper b-d anyway.
[ Igor Pashev ]
+ * Added SMF service (debian/lighttpd.smf/)
* Added build-dep dh-smf [illumos-any]
* debian/lighty-enable-mod prints how to restart lighttd
with SMF if running SMF
- -- Igor Pashev <pashev.igor@gmail.com> Thu, 18 Jul 2013 22:17:47 +0400
+ -- Igor Pashev <pashev.igor@gmail.com> Fri, 19 Jul 2013 02:50:10 +0400
lighttpd (1.4.31-4) unstable; urgency=high
diff --git a/debian/lighttpd.smf/manifest/network/lighttpd.xml b/debian/lighttpd.smf/manifest/network/lighttpd.xml
new file mode 100644
index 0000000..1cdc4db
--- /dev/null
+++ b/debian/lighttpd.smf/manifest/network/lighttpd.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0"?>
+<!DOCTYPE service_bundle SYSTEM "/usr/share/xml/schema/smf/service_bundle.dtd.1">
+<service_bundle type="manifest" name="lighttpd">
+ <service name="network/lighttpd" type="service" version="1">
+ <create_default_instance enabled="true"/>
+ <dependency name="loopback" grouping="require_all" restart_on="error" type="service">
+ <service_fmri value="svc:/network/loopback:default"/>
+ </dependency>
+ <dependency name="lighttpd_conf" grouping="require_all" restart_on="restart" type="path">
+ <service_fmri value="file://localhost/etc/lighttpd/lighttpd.conf"/>
+ </dependency>
+ <dependency name="physical" grouping="optional_all" restart_on="error" type="service">
+ <service_fmri value="svc:/network/physical:default"/>
+ </dependency>
+ <dependency name="multiuser-server" grouping="require_all" restart_on="error" type="service">
+ <service_fmri value="svc:/milestone/multi-user-server:default"/>
+ </dependency>
+ <exec_method type="method" name="start" exec="/lib/svc/method/lighttpd start" timeout_seconds="60"/>
+ <exec_method type="method" name="stop" exec=":kill -INT" timeout_seconds="60"/>
+ <exec_method type="method" name="refresh" exec=":kill -HUP" timeout_seconds="60"/>
+ <property_group name="startd" type="framework">
+ <propval name="ignore_error" type="astring" value="core,signal"/>
+ </property_group>
+ <template>
+ <common_name>
+ <loctext xml:lang="C">Lighttpd HTTP server</loctext>
+ </common_name>
+ <documentation>
+ <manpage title="lighttpd" section="8"/>
+ <manpage title="lighty-enable-mod" section="1"/>
+ </documentation>
+ </template>
+ </service>
+</service_bundle>
diff --git a/debian/lighttpd.smf/method/lighttpd b/debian/lighttpd.smf/method/lighttpd
new file mode 100644
index 0000000..41fcf15
--- /dev/null
+++ b/debian/lighttpd.smf/method/lighttpd
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+set -e
+
+DAEMON=/usr/sbin/lighttpd
+CONFIG=/etc/lighttpd/lighttpd.conf
+
+start () {
+ "$DAEMON" -t -f "$CONFIG" >/dev/null || exit $?
+
+ if ! dpkg-statoverride --list /var/run/lighttpd >/dev/null 2>&1; then
+ install -d -o www-data -g www-data -m 0750 "/var/run/lighttpd"
+ fi
+
+ "$DAEMON" -f "$CONFIG"
+}
+
+if [ -n "$2" ]; then
+ CONFIG="$2"
+fi
+
+case "$1" in
+ start) start;;
+esac
+
+exit 0;