1
|
1.进入目录/usr/lib/systemed/system
|
2
|
|
3
|
cd /usr/lib/systemed/system
|
4
|
|
5
|
2.创建文件aas.service
|
6
|
|
7
|
touch aas.service
|
8
|
|
9
|
3.编辑aas.service文件
|
10
|
|
11
|
vi aas.service
|
12
|
|
13
|
[Unit]
|
14
|
Description=AASV9.0 Service
|
15
|
[Service]
|
16
|
Type=forking
|
17
|
Environment="JAVA_HOME=/opt/jdk1.8.0_202" (jdk安装路径)
|
18
|
ExecStart=/opt/AASV9/domains/mydomain/bin/startapusic (金蝶V9启动脚本路径)
|
19
|
ExecReload=/bin/kill -s HUP $MAINPID
|
20
|
ExecStop=/bin/kill -s QUIT $MAINPID
|
21
|
[Install]
|
22
|
WantedBy=multi-user.target
|
23
|
|
24
|
|
25
|
找到中间件启动脚本/opt/AAS/domains/mydomain/bin里面的startapusic脚本然后找到最下面一行
|
26
|
|
27
|
4.修改启动脚本startapusic(在最下面附近)并注释掉最下面那个。
|
28
|
exec $JAVA_RUN -Djava.endorsed.dirs="$APUSIC_ENDORSED_DIRS" -Dcom.apusic.domain.home="$DOMAIN_HOME" $JVM_OPTS -classpath "$CP" com.apusic.server.Main -root "$APUSIC_HOME" "$@" &
|
29
|
(前边加exec 后边加&)
|
30
|
|
31
|
(注释):首行加入exec 末尾加入&
|
32
|
|
33
|
|
34
|
systemctl daemon-reload --重新加载aas.service配置文件
|
35
|
|
36
|
systemctl status aas --查看中间件运行状态
|
37
|
|
38
|
systemctl start aas --启动中间件
|
39
|
|
40
|
systemctl stop aas --停止中间件
|
41
|
|
42
|
systemctl restart aas --重启中间件
|
43
|
|
44
|
systemctl enable aas --设置开机自启动
|
45
|
|
46
|
systemctl disable aas --关闭开机自启动
|
47
|
|
48
|
|
49
|
|
50
|
|
51
|
|