Permalink
Browse files

Adds BSD support

git-svn-id: svn://cherokee-project.com/installer@6294 5dc97367-97f1-0310-9951-d761b3857238
  • Loading branch information...
1 parent f11c93d commit 00d56eb5ae320d141e65aa6bc451aaf42a93a842 @alobbs alobbs committed Feb 14, 2011
Showing with 34 additions and 0 deletions.
  1. +34 −0 install.py
View
@@ -194,6 +194,21 @@
exit 0
"""
+BSD_INIT = """\
+#!/bin/sh
+
+. /etc/rc.subr
+
+name="cherokee"
+rcvar="`set_rcvar`"
+command="%(prefix)s/sbin/cherokee"
+
+load_rc_config $name
+command_args="-d"
+
+run_rc_command "$1"
+"""
+
# Globals
#
@@ -499,6 +514,25 @@ def smf_present():
print ("INFO: Skipping SVC, SMF not present")
return
+ # BSD
+ if 'bsd' in sys.platform.lower():
+ rcd_fp = '/etc/rc.d/cherokee'
+
+ # Preliminary clean up
+ exe_sudo ("rm -f '%s'"%(rcd_fp))
+
+ # Write the init.d file
+ txt = BSD_INIT %(variables)
+ f = open (rcd_fp, 'w+')
+ f.write (txt)
+ f.close()
+
+ # Permissions
+ exe_sudo ("chown root '%s'" %(rcd_fp))
+ exe_sudo ("chmod 555 '%s'" %(rcd_fp))
+
+ return
+
# Init.d
if os.path.isdir ("/etc/init.d"):
# Figure runlevel

0 comments on commit 00d56eb

Please sign in to comment.