Getting delay of stopping the running services in the background when reboot happens

Hi,
I am making the wifi ap mode to default in the imx8mp solidrun board by creating the own service.

  1. config.sh is my script file which is having all configuration settings like below.

#!/bin/bash
echo -e “ctrl_interface=/var/run/hostapd\n”“ctrl_interface_group=0\n”“country_code=IN\n”“interface=wlan0\n”“hw_mode=a\n”“channel=48\n”“macaddr_acl=0\n”“auth_algs=1\n”“ignore_broadcast_ssid=0\n”“wpa=2\n”“wpa_key_mgmt=WPA-PSK\n”“wpa_pairwise=TKIP\n”“rsn_pairwise=CCMP\n”“driver=nl80211\n”“ssid=test\n”“wpa_passphrase=test@1234” > /etc/hostapd.conf

echo -e “interface wlan0\n”“static ip_address=192.168.4.1/24\n”“nohook wpa_supplicant=wlan0” > /etc/dhcpcd.conf

echo -e “interface=wlan0\n”“dhcp-range=192.168.4.2,192.168.4.20,255.255.255.0,24h\n”“domain=wlan\n”“address=/gw.wlan/192.168.4.1” > /etc/dnsmasq.conf

echo -e “net.ipv4.ip_forward=1” > /etc/sysctl.d/99-sysctl.conf

echo -e “nameserver 8.8.8.8” > /etc/resolv.conf

hostapd /etc/hostapd.conf

2.config.service is my service file to start the service default at boot time.

[Unit]
Description=Default Wi-Fi AP mode
After=network.target

[Service]
Type=oneshot
ExecStart=/usr/bin/config.sh
Restart=on-failure
RestartSec=1s

[Install]
WantedBy=multi-user.target

After creation of above files i have executed the below commands to start the service.
$ sudo systemctl daemon-reload
$ sudo systemctl enable config_setup.service
$ systemctl restart config_setup.service
$ systemctl status config_setup.service

So, This is working and getting wlan0 interface link up message log at boot as shown in below.
###########################################
[ 3.140618] caam 30900000.crypto: registering rng-caam
[ 3.151400] Device caam-keygen registered
[ 3.172388] random: crng init done
[ 3.175810] random: 7 urandom warning(s) missed due to ratelimiting
[ 3.262640] Bluetooth: hci0: BCM4345C0 NXP UART 37.4 MHz BT 4.2
[ 3.268631] Bluetooth: hci0: BCM4345C0 (003.001.025) build 0337
[ 3.271761] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[ 3.332367] NET: Registered protocol family 38
[ 3.434891] audit: type=1006 audit(1616581520.468:3): pid=395 uid=0 old-auid=4294967295 auid=0 tty=tty7 old-ses=4294967295 ses=2 res=1
[ 3.518284] i2c_transfer() failed: -6
[ 3.522234] basler_read_register_chunk() failed: -6
[ 3.527343] basler_read_register() failed: -6
[ 3.543740] EXT4-fs (mmcblk2p1): mounted filesystem with ordered data mode. Opts: (null)
[ 3.586896] imx8_media_dev: module is from the staging directory, the quality is unknown, you have been warned.
[FAILED] Failed to start Weston, a …mpositor, as a system service.
[ 3.638498] enter viv_video_init_module
[ 3.689264] enter viv_dwe_init_module
[ 3.729569] enter viv_isp_init_module

NXP i.MX Release Distro 5.10-hardknott imx8mpsolidrun ttymxc1
####################################################

But, I have seen the 90sec delay when the board starts to reboot and got the log message as shown in the below snapshot.

Could you please tell me the possible way to reduce the wait time of the dhcpv6 service.

Regards

Hi,

I could not find anything about related to my query.
Please let me know the steps to stop the service in very less time.

Regards.