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

**URL:** <https://community.solid-run.com/t/getting-delay-of-stopping-the-running-services-in-the-background-when-reboot-happens/835>\
**Category:** NXP i.MX8M Plus\
**Tags:** iMX8M-plus\
**Created:** [April 23, 2024, 1:52pm UTC](https://community.solid-run.com/t/getting-delay-of-stopping-the-running-services-in-the-background-when-reboot-happens/835 "2024-04-23T13:52:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![manoj](https://avatars.discourse-cdn.com/v4/letter/m/d9b06d/32.png) [@manoj](https://community.solid-run.com/u/manoj)\
**Post date:** [April 23, 2024, 1:52pm UTC](https://community.solid-run.com/t/getting-delay-of-stopping-the-running-services-in-the-background-when-reboot-happens/835/1 "2024-04-23T13:52:24Z")

</div>

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.

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/solid_run/original/1X/64d4627973b04c22faf2c98614e9512bcd9c2d00.png)

Regards

---

<div class="post-metadata">

**Author:** ![manoj](https://avatars.discourse-cdn.com/v4/letter/m/d9b06d/32.png) [@manoj](https://community.solid-run.com/u/manoj)\
**Post date:** [April 25, 2024, 8:56am UTC](https://community.solid-run.com/t/getting-delay-of-stopping-the-running-services-in-the-background-when-reboot-happens/835/2 "2024-04-25T08:56:02Z")

</div>

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.
