diff --git a/deploy/ansible.yml b/deploy/ansible.yml index 9b2e702..240d284 100644 --- a/deploy/ansible.yml +++ b/deploy/ansible.yml @@ -18,4 +18,4 @@ mode: 0777 backup: no - name: shell - shell: cd {{ deploy_dir }} && sudo systemctl restart jx-print + shell: sudo systemctl restart jx-print diff --git a/deploy/cleanup.sh b/deploy/cleanup.sh index 983bc0c..5fe8ef9 100644 --- a/deploy/cleanup.sh +++ b/deploy/cleanup.sh @@ -4,4 +4,6 @@ if [ ! -d "backup" ]; then mkdir backup fi -mv jx-print.*~ backup/ +if ls jx-print.*~ > /dev/null 2>&1; then + mv jx-print.*~ backup/ +fi \ No newline at end of file diff --git a/deploy/jx-print.service b/deploy/jx-print.service index a40a94e..79f2586 100644 --- a/deploy/jx-print.service +++ b/deploy/jx-print.service @@ -1,24 +1,24 @@ -#[Unit] -#Description=jx-print service -#Wants=mysql.service -#After=network.target -#After=mysql.service -# -#[Service] -#LimitCORE=infinity -#LimitNOFILE=100000 -#LimitNPROC=100000 -# -#Environment="GOPATH=/home/ubuntu/go/" -#Type=simple -#User=ubuntu -#Group=ubuntu -# -#Restart=always -#RestartSec=500ms -# -#WorkingDirectory=/jxdata/jx-callback-print -#ExecStart=/bin/sh -c '/jxdata/jx-callback-print/jx-print >> /jxdata/jx-callback-print/jx-print.log 2>&1' -# -#[Install] -#WantedBy=multi-user.target \ No newline at end of file +[Unit] +Description=jx-print service +Wants=mysql.service +After=network.target +After=mysql.service + +[Service] +LimitCORE=infinity +LimitNOFILE=100000 +LimitNPROC=100000 + +Environment="GOPATH=/home/ubuntu/go/" +Type=simple +User=ubuntu +Group=ubuntu + +Restart=always +RestartSec=500ms + +WorkingDirectory=/jxdata/jx-callback-print +ExecStart=/bin/sh -c '/jxdata/jx-callback-print/jx-print >> /jxdata/jx-callback-print/jx-print.log 2>&1' + +[Install] +WantedBy=multi-user.target \ No newline at end of file