[FS#3854] procd / inittab does not restart compiled c application when it closes

OpenWrt Bugs openwrt-bugs at lists.openwrt.org
Fri Jun 4 14:51:16 PDT 2021


THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.

A new Flyspray task has been opened.  Details are below. 

User who did this - Ke (kse) 

Attached to Project - OpenWrt/LEDE Project
Summary - procd / inittab does not restart compiled c application when it closes
Task Type - Bug Report
Category - Base system
Status - Unconfirmed
Assigned To - 
Operating System - All
Severity - Low
Priority - Very Low
Reported Version - Trunk
Due in Version - Undecided
Due Date - Undecided
Details - Supply the following if possible:
 - Device problem occurs on
 - Software versions of OpenWrt/LEDE release, packages, etc.
 - Steps to reproduce
   
Issue Overview: I have a test application that should be respawned via procd when/if it is ever closed. Procd doesn't re-launch this application. I have built a test app (detailed below) to limit the variables in testing.

Device: GL-iNet GL-MT300N-V2
Software Versions: OpenWRT Version 19.07.7 (All versions of 19.07 -> 21.02 I have used are currently been experiencing this. 18.06 does not appear to have this issue for me) - Packages included (selected with imagebuilder):
CONFIG_TARGET_ramips=y
CONFIG_TARGET_ramips_mt76x8=y
CONFIG_TARGET_MULTI_PROFILE=y
CONFIG_TARGET_DEVICE_ramips_mt76x8_DEVICE_alfa-network_awusfree1=y
CONFIG_TARGET_DEVICE_PACKAGES_ramips_mt76x8_DEVICE_alfa-network_awusfree1=""
CONFIG_TARGET_DEVICE_ramips_mt76x8_DEVICE_wcr-1166ds=y
CONFIG_TARGET_DEVICE_PACKAGES_ramips_mt76x8_DEVICE_wcr-1166ds=""
CONFIG_TARGET_DEVICE_ramips_mt76x8_DEVICE_cudy_wr1000=y
CONFIG_TARGET_DEVICE_PACKAGES_ramips_mt76x8_DEVICE_cudy_wr1000=""
CONFIG_TARGET_DEVICE_ramips_mt76x8_DEVICE_duzun-dm06=y
CONFIG_TARGET_DEVICE_PACKAGES_ramips_mt76x8_DEVICE_duzun-dm06=""
CONFIG_TARGET_DEVICE_ramips_mt76x8_DEVICE_gl-mt300n-v2=y
CONFIG_TARGET_DEVICE_PACKAGES_ramips_mt76x8_DEVICE_gl-mt300n-v2=""
CONFIG_TARGET_DEVICE_ramips_mt76x8_DEVICE_glinet_vixmini=y
CONFIG_TARGET_DEVICE_PACKAGES_ramips_mt76x8_DEVICE_glinet_vixmini=""
CONFIG_TARGET_DEVICE_ramips_mt76x8_DEVICE_hilink_hlk-7628n=y
CONFIG_TARGET_DEVICE_PACKAGES_ramips_mt76x8_DEVICE_hilink_hlk-7628n=""
CONFIG_TARGET_DEVICE_ramips_mt76x8_DEVICE_hc5661a=y
CONFIG_TARGET_DEVICE_PACKAGES_ramips_mt76x8_DEVICE_hc5661a=""
CONFIG_TARGET_DEVICE_ramips_mt76x8_DEVICE_hiwifi_hc5861b=y
CONFIG_TARGET_DEVICE_PACKAGES_ramips_mt76x8_DEVICE_hiwifi_hc5861b=""
CONFIG_TARGET_DEVICE_ramips_mt76x8_DEVICE_LinkIt7688=y
CONFIG_TARGET_DEVICE_PACKAGES_ramips_mt76x8_DEVICE_LinkIt7688=""
CONFIG_TARGET_DEVICE_ramips_mt76x8_DEVICE_mt7628=y
CONFIG_TARGET_DEVICE_PACKAGES_ramips_mt76x8_DEVICE_mt7628=""
CONFIG_TARGET_DEVICE_ramips_mt76x8_DEVICE_mac1200r-v2=y
CONFIG_TARGET_DEVICE_PACKAGES_ramips_mt76x8_DEVICE_mac1200r-v2=""
CONFIG_TARGET_DEVICE_ramips_mt76x8_DEVICE_netgear_r6120=y
CONFIG_TARGET_DEVICE_PACKAGES_ramips_mt76x8_DEVICE_netgear_r6120=""
CONFIG_TARGET_DEVICE_ramips_mt76x8_DEVICE_omega2=y
CONFIG_TARGET_DEVICE_PACKAGES_ramips_mt76x8_DEVICE_omega2=""
CONFIG_TARGET_DEVICE_ramips_mt76x8_DEVICE_omega2p=y
CONFIG_TARGET_DEVICE_PACKAGES_ramips_mt76x8_DEVICE_omega2p=""
CONFIG_TARGET_DEVICE_ramips_mt76x8_DEVICE_pbr-d1=y
CONFIG_TARGET_DEVICE_PACKAGES_ramips_mt76x8_DEVICE_pbr-d1=""
CONFIG_TARGET_DEVICE_ramips_mt76x8_DEVICE_rakwireless_rak633=y
CONFIG_TARGET_DEVICE_PACKAGES_ramips_mt76x8_DEVICE_rakwireless_rak633=""
CONFIG_TARGET_DEVICE_ramips_mt76x8_DEVICE_skylab_skw92a=y
CONFIG_TARGET_DEVICE_PACKAGES_ramips_mt76x8_DEVICE_skylab_skw92a=""
CONFIG_TARGET_DEVICE_ramips_mt76x8_DEVICE_tama_w06=y
CONFIG_TARGET_DEVICE_PACKAGES_ramips_mt76x8_DEVICE_tama_w06=""
CONFIG_TARGET_DEVICE_ramips_mt76x8_DEVICE_totolink_lr1200=y
CONFIG_TARGET_DEVICE_PACKAGES_ramips_mt76x8_DEVICE_totolink_lr1200=""
CONFIG_TARGET_DEVICE_ramips_mt76x8_DEVICE_tplink_c20-v4=y
CONFIG_TARGET_DEVICE_PACKAGES_ramips_mt76x8_DEVICE_tplink_c20-v4=""
CONFIG_TARGET_DEVICE_ramips_mt76x8_DEVICE_tplink_c50-v3=y
CONFIG_TARGET_DEVICE_PACKAGES_ramips_mt76x8_DEVICE_tplink_c50-v3=""
CONFIG_TARGET_DEVICE_ramips_mt76x8_DEVICE_tplink_c50-v4=y
CONFIG_TARGET_DEVICE_PACKAGES_ramips_mt76x8_DEVICE_tplink_c50-v4=""
CONFIG_TARGET_DEVICE_ramips_mt76x8_DEVICE_tplink_tl-mr3020-v3=y
CONFIG_TARGET_DEVICE_PACKAGES_ramips_mt76x8_DEVICE_tplink_tl-mr3020-v3=""
CONFIG_TARGET_DEVICE_ramips_mt76x8_DEVICE_tplink_tl-mr3420-v5=y
CONFIG_TARGET_DEVICE_PACKAGES_ramips_mt76x8_DEVICE_tplink_tl-mr3420-v5=""
CONFIG_TARGET_DEVICE_ramips_mt76x8_DEVICE_tplink_tl-wa801nd-v5=y
CONFIG_TARGET_DEVICE_PACKAGES_ramips_mt76x8_DEVICE_tplink_tl-wa801nd-v5=""
CONFIG_TARGET_DEVICE_ramips_mt76x8_DEVICE_tplink_tl-wr802n-v4=y
CONFIG_TARGET_DEVICE_PACKAGES_ramips_mt76x8_DEVICE_tplink_tl-wr802n-v4=""
CONFIG_TARGET_DEVICE_ramips_mt76x8_DEVICE_tl-wr840n-v4=y
CONFIG_TARGET_DEVICE_PACKAGES_ramips_mt76x8_DEVICE_tl-wr840n-v4=""
CONFIG_TARGET_DEVICE_ramips_mt76x8_DEVICE_tl-wr841n-v13=y
CONFIG_TARGET_DEVICE_PACKAGES_ramips_mt76x8_DEVICE_tl-wr841n-v13=""
CONFIG_TARGET_DEVICE_ramips_mt76x8_DEVICE_tplink_tl-wr842n-v5=y
CONFIG_TARGET_DEVICE_PACKAGES_ramips_mt76x8_DEVICE_tplink_tl-wr842n-v5=""
CONFIG_TARGET_DEVICE_ramips_mt76x8_DEVICE_tplink_tl-wr902ac-v3=y
CONFIG_TARGET_DEVICE_PACKAGES_ramips_mt76x8_DEVICE_tplink_tl-wr902ac-v3=""
CONFIG_TARGET_DEVICE_ramips_mt76x8_DEVICE_u7628-01-128M-16M=y
CONFIG_TARGET_DEVICE_PACKAGES_ramips_mt76x8_DEVICE_u7628-01-128M-16M=""
CONFIG_TARGET_DEVICE_ramips_mt76x8_DEVICE_vocore2=y
CONFIG_TARGET_DEVICE_PACKAGES_ramips_mt76x8_DEVICE_vocore2=""
CONFIG_TARGET_DEVICE_ramips_mt76x8_DEVICE_vocore2lite=y
CONFIG_TARGET_DEVICE_PACKAGES_ramips_mt76x8_DEVICE_vocore2lite=""
CONFIG_TARGET_DEVICE_ramips_mt76x8_DEVICE_wavlink_wl-wn570ha1=y
CONFIG_TARGET_DEVICE_PACKAGES_ramips_mt76x8_DEVICE_wavlink_wl-wn570ha1=""
CONFIG_TARGET_DEVICE_ramips_mt76x8_DEVICE_wavlink_wl-wn575a3=y
CONFIG_TARGET_DEVICE_PACKAGES_ramips_mt76x8_DEVICE_wavlink_wl-wn575a3=""
CONFIG_TARGET_DEVICE_ramips_mt76x8_DEVICE_widora_neo-16m=y
CONFIG_TARGET_DEVICE_PACKAGES_ramips_mt76x8_DEVICE_widora_neo-16m=""
CONFIG_TARGET_DEVICE_ramips_mt76x8_DEVICE_widora_neo-32m=y
CONFIG_TARGET_DEVICE_PACKAGES_ramips_mt76x8_DEVICE_widora_neo-32m=""
CONFIG_TARGET_DEVICE_ramips_mt76x8_DEVICE_wiznet_wizfi630s=y
CONFIG_TARGET_DEVICE_PACKAGES_ramips_mt76x8_DEVICE_wiznet_wizfi630s=""
CONFIG_TARGET_DEVICE_ramips_mt76x8_DEVICE_wrtnode2p=y
CONFIG_TARGET_DEVICE_PACKAGES_ramips_mt76x8_DEVICE_wrtnode2p=""
CONFIG_TARGET_DEVICE_ramips_mt76x8_DEVICE_wrtnode2r=y
CONFIG_TARGET_DEVICE_PACKAGES_ramips_mt76x8_DEVICE_wrtnode2r=""
CONFIG_TARGET_DEVICE_ramips_mt76x8_DEVICE_xiaomi_mir4a-100m=y
CONFIG_TARGET_DEVICE_PACKAGES_ramips_mt76x8_DEVICE_xiaomi_mir4a-100m=""
CONFIG_TARGET_DEVICE_ramips_mt76x8_DEVICE_miwifi-nano=y
CONFIG_TARGET_DEVICE_PACKAGES_ramips_mt76x8_DEVICE_miwifi-nano=""
CONFIG_TARGET_DEVICE_ramips_mt76x8_DEVICE_zbtlink_zbt-we1226=y
CONFIG_TARGET_DEVICE_PACKAGES_ramips_mt76x8_DEVICE_zbtlink_zbt-we1226=""
CONFIG_TARGET_DEVICE_ramips_mt76x8_DEVICE_zyxel_keenetic-extra-ii=y
CONFIG_TARGET_DEVICE_PACKAGES_ramips_mt76x8_DEVICE_zyxel_keenetic-extra-ii=""
CONFIG_DEVEL=y
CONFIG_TARGET_PER_DEVICE_ROOTFS=y
CONFIG_LIBCURL_NGHTTP2=y
CONFIG_LIBCURL_THREADED_RESOLVER=y
CONFIG_LIBCURL_ZLIB=y
CONFIG_PACKAGE_arp-scan=y
CONFIG_PACKAGE_arp-scan-database=y
CONFIG_PACKAGE_ca-bundle=y
CONFIG_PACKAGE_libcurl=y
CONFIG_PACKAGE_libmbedtls=y
CONFIG_PACKAGE_libnghttp2=y
CONFIG_PACKAGE_liboping=y
CONFIG_PACKAGE_libpcap=y
CONFIG_PACKAGE_librt=y
CONFIG_PACKAGE_zlib=y
CONFIG_ZLIB_OPTIMIZE_SPEED=y

I am building a fairly a stripped-down build of OpenWRT. However, from what I can tell at least, I should have at least the minimum required dependencies/packages/etc. for the application to be respawned correctly.

Repro steps:
I've written a test application to isolate issues. This test app is configured to respawn in the exact same way I have my primary application configured. After testing with the test app, this issue persists I can confirm it will not respawn when the application is closed. I can also confirm that the applications themselves will launch and run correctly on the machine if executed. The only thing I cannot get to work at the moment is the procd respawn. However, I should also add that I have a shell script does respawn correctly. 

Source code for this app:
Base app:
#include 
int main() {
   printf("Hello, World!");
   return 0;
}

Launcher (This is what should respawn on app end)
#include 
#include 
#include 
#include 
#include 
#include 

int main()
{
	pid_t pid = fork();

	if(pid == 0)
	{
		char * args[2];
		args[0] = malloc(strlen("HelloWorldBase") + 1);
		strcpy(args[0], "HelloWorldBase");
		args[1] = NULL;
		execve("HelloWorldBase", args, NULL);
		abort();
	}

	int status = 0;
	wait(&status);
	return 0;
}

inittab file:
::sysinit:/etc/init.d/rcS S boot
::shutdown:/etc/init.d/rcS K shutdown
::respawn:/root/app/HelloWorldBaseLauncher
::askconsole:/bin/login
::respawn:/bin/sh /bin/working-script

I have confirmed that application is compiled correctly and will run correctly when it is directly run. I have also confirmed that shell script in /bin/ folder will respawn as expected. It just seems that the compiled application itself will not respawn.
Additionally, I do not see any console output or errors visible from logread when the application should respawn.

More information can be found at the following URL:
https://bugs.openwrt.org/index.php?do=details&task_id=3854

You are receiving this message because you have requested it from the Flyspray bugtracking system.  If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.



More information about the openwrt-bugs mailing list