Bozhidar Slaveykov 1 年之前
父節點
當前提交
7bd7f0ded9
共有 3 個文件被更改,包括 18 次插入0 次删除
  1. 2 0
      compilators/debian/nginx/nginx-compile.sh
  2. 11 0
      compilators/debian/nginx/postinst
  3. 5 0
      compilators/debian/nginx/postrm

+ 2 - 0
compilators/debian/nginx/nginx-compile.sh

@@ -32,6 +32,8 @@ sudo mv $PACKAGE_MAIN_DIR/usr/local/alphax/nginx/sbin/nginx $PACKAGE_MAIN_DIR/us
 
 # Copy debian package META file
 sudo cp $MAIN_DIR/control $PACKAGE_MAIN_DIR/DEBIAN
+sudo cp $MAIN_DIR/postinst $PACKAGE_MAIN_DIR/DEBIAN
+sudo cp $MAIN_DIR/postrm $PACKAGE_MAIN_DIR/DEBIAN
 
 # Copy ALPHAX series files
 sudo cp $MAIN_DIR/alphax $PACKAGE_MAIN_DIR/etc/init.d/alphax

+ 11 - 0
compilators/debian/nginx/postinst

@@ -0,0 +1,11 @@
+#!/bin/bash
+
+set -e
+
+if [ "$1" != "configure" ]; then
+	exit 0
+fi
+
+# Touch and set permisions on default log files on installation
+update-rc.d alphax defaults > /dev/null
+invoke-rc.d alphax start || true

+ 5 - 0
compilators/debian/nginx/postrm

@@ -0,0 +1,5 @@
+#!/bin/sh
+
+update-rc.d alphax remove > /dev/null 2>&1
+
+exit 0