Skip to content

Commit 7647e97

Browse files
committed
packages: fixed issues found by internal CI
1 parent df07725 commit 7647e97

File tree

4 files changed

+39
-4
lines changed

4 files changed

+39
-4
lines changed

etc/chkconfig/amplify-agent

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,19 @@ start() {
7575
chown -f $user /etc/amplify-agent/agent.conf
7676
chown -f $user /var/log/amplify-agent/agent.log
7777
daemon --user=$user $binary start --config=$conffile --pid=$pidfile
78-
fi;
78+
fi
79+
RETVAL="$?"
7980
echo
80-
return $RETVAL
81+
if [ "$RETVAL" -ne 0 ]; then
82+
return "$RETVAL"
83+
fi
84+
for i in 1 2 3 4 5; do
85+
if [ -e "$pidfile" ]; then
86+
return 0
87+
fi
88+
sleep 1
89+
done
90+
return 1
8191
}
8292

8393
stop() {
@@ -123,6 +133,13 @@ debug() {
123133

124134
case "$1" in
125135
start)
136+
if status -p $pidfile amplify-agent >/dev/null 2>&1; then
137+
echo "amplify-agent is already running" >&2
138+
exit 0
139+
fi
140+
if [ -e "$pidfile" ]; then
141+
rm -f "$pidfile"
142+
fi
126143
start
127144
RETVAL=$?
128145
;;
@@ -135,7 +152,7 @@ case "$1" in
135152
RETVAL=$?
136153
;;
137154
status)
138-
status -p $pidfile amplify-agent
155+
status -p $pidfile amplify-agent
139156
RETVAL=$?
140157
;;
141158
configtest)

etc/init.d/amplify-agent

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,16 @@ do_start()
6666
chown -f $USER /var/log/amplify-agent/agent.log
6767
start-stop-daemon --start --chuid $USER --exec $DAEMON start -- $DAEMON_ARGS
6868
RETVAL="$?"
69-
return "$RETVAL"
69+
if [ "$RETVAL" -ne 0 ]; then
70+
return "$RETVAL"
71+
fi
72+
for i in 1 2 3 4 5; do
73+
if [ -e "$PIDFILE" ]; then
74+
return 0
75+
fi
76+
sleep 1
77+
done
78+
return 1
7079
}
7180

7281
do_stop()
@@ -94,6 +103,13 @@ do_debug() {
94103

95104
case "$1" in
96105
start)
106+
if status_of_proc -p "$PIDFILE" "$DAEMON" "$NAME" >/dev/null 2>&1; then
107+
echo " * $NAME is already running" >&2
108+
exit 0
109+
fi
110+
if [ -e "$PIDFILE" ]; then
111+
rm -f "$PIDFILE"
112+
fi
97113
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME"
98114
do_start
99115
case "$?" in

packages/nginx-amplify-agent/deb/debian/control.noble

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Architecture: any
2222
Depends: ${misc:Depends},
2323
${python3:Depends},
2424
python3-daemon,
25+
python3-pyasyncore,
2526
python3-setproctitle,
2627
python3-greenlet,
2728
python3-gevent,

tools/builders/deb.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
'bullseye': 13,
2020
'jammy': 13,
2121
'bookworm': 13,
22+
'noble': 13,
2223
}
2324

2425

0 commit comments

Comments
 (0)