@@ -36,7 +36,7 @@ function updateSyslogConf()
36
36
TARGET_IP=$( docker network inspect bridge --format={{ " '{{(index .IPAM.Config 0).Gateway}}'" }})
37
37
CONTAINER_NAME=" $DOCKERNAME "
38
38
TMP_FILE=" /tmp/rsyslog.$CONTAINER_NAME .conf"
39
- {%- if docker_container_name == " database" %}
39
+ {%- if docker_container_name == " database" %}
40
40
python -c " import jinja2, os; paths=['/usr/share/sonic/templates']; loader = jinja2.FileSystemLoader(paths); env = jinja2.Environment(loader=loader, trim_blocks=True); template_file='/usr/share/sonic/templates/rsyslog-container.conf.j2'; template = env.get_template(os.path.basename(template_file)); data=template.render({\" target_ip\" :\" $TARGET_IP \" ,\" container_name\" :\" $CONTAINER_NAME \" }); print(data)" > $TMP_FILE
41
41
{%- else %}
42
42
sonic-cfggen -t /usr/share/sonic/templates/rsyslog-container.conf.j2 -a " {\" target_ip\" : \" $TARGET_IP \" , \" container_name\" : \" $CONTAINER_NAME \" }" > $TMP_FILE
@@ -105,7 +105,7 @@ function preStartAction()
105
105
if [[ $( /bin/systemctl status watchdog-control.service | grep -c running) -gt 0 ]]; then
106
106
echo " Stopping watchdog-control.service before starting PDE"
107
107
systemctl stop watchdog-control.service
108
- fi
108
+ fi
109
109
{%- elif docker_container_name == " snmp" %}
110
110
$SONIC_DB_CLI STATE_DB HSET ' DEVICE_METADATA|localhost' chassis_serial_number $( decode-syseeprom -s)
111
111
{%- else %}
@@ -500,6 +500,17 @@ stop() {
500
500
{%- endif %}
501
501
}
502
502
503
+ kill () {
504
+ {%- if docker_container_name == " database" %}
505
+ docker kill $DOCKERNAME
506
+ if [ " $DEV " ]; then
507
+ ip netns delete " $NET_NS "
508
+ fi
509
+ {%- else %}
510
+ /usr/local/bin/container kill $DOCKERNAME
511
+ {%- endif %}
512
+ }
513
+
503
514
DOCKERNAME={{docker_container_name}}
504
515
OP=$1
505
516
DEV=$2 # namespace/device number to operate on
527
538
[ -f /etc/sonic/sonic-environment ] && . /etc/sonic/sonic-environment
528
539
529
540
case " $1 " in
530
- start|wait|stop)
541
+ start|wait|stop|kill )
531
542
$1
532
543
;;
533
544
* )
0 commit comments