Permalink
Browse files

bashttpd add systemd units

  • Loading branch information...
1 parent b1017d0 commit 2f40e513079f03aeee03ffc40b5e333723587666 @microcai committed Oct 5, 2012
@@ -1 +1 @@
-DIST bashttpd-0.1 3213 RMD160 8cc45ded8391cb4f08cc90a8b495318ee38f4238 SHA1 9cd7a0ddb8ec0aee7e4cf3a216bc643c3301b6fc SHA256 ae0eea9dd69a670d9342dafe1a38c850d077da922a136fa2bdf6b981091ff53f
+DIST bashttpd-0.1 3213 SHA256 ae0eea9dd69a670d9342dafe1a38c850d077da922a136fa2bdf6b981091ff53f
@@ -4,7 +4,7 @@
EAPI=3
-inherit googlecode
+inherit systemd googlecode
S=""
@@ -14,14 +14,24 @@ SRC_URI="${HOMEPAGE}/files/${P}"
LICENSE="GPL-3"
SLOT="0"
KEYWORDS="amd64 x86 arm mips alpha"
-IUSE=""
+IUSE="systemd"
RDEPEND="${DEPEND}
app-shells/bash
sys-apps/coreutils
+ systemd? ( sys-apps/systemd )
"
src_install(){
dodir /usr/bin
install ${DISTDIR}/${P} ${D}/usr/bin/bashttpd
+
+ if use systemd ; then
+ systemd_dounit ${FILESDIR}/http-alt.socket
+ systemd_dounit ${FILESDIR}/http-alt@.service
+
+ systemd_dounit ${FILESDIR}/http.socket
+ systemd_dounit ${FILESDIR}/http@.service
+
+ fi
}
@@ -0,0 +1,12 @@
+[Unit]
+Description=very simple HTTP index daemon
+
+
+[Socket]
+Accept=yes
+
+ListenStream=8000
+[Install]
+WantedBy=sockets.target
+
+
@@ -0,0 +1,8 @@
+[Service]
+
+User=www
+Group=root
+WorkingDirectory=/usr/portage
+StandardInput=socket
+StandardOutput=socket
+ExecStart=-/usr/bin/bashttpd
@@ -0,0 +1,12 @@
+[Unit]
+Description=very simple HTTP index daemon
+
+
+[Socket]
+Accept=yes
+
+ListenStream=80
+[Install]
+WantedBy=sockets.target
+
+
@@ -0,0 +1,8 @@
+[Service]
+
+User=www
+Group=root
+WorkingDirectory=/usr/portage
+StandardInput=socket
+StandardOutput=socket
+ExecStart=-/usr/bin/bashttpd

0 comments on commit 2f40e51

Please sign in to comment.