From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f172.google.com (mail-qk1-f172.google.com [209.85.222.172]) by mx.groups.io with SMTP id smtpd.web12.1075.1608317227214313543 for ; Fri, 18 Dec 2020 10:47:07 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20161025 header.b=T13AvDJw; spf=pass (domain: gmail.com, ip: 209.85.222.172, mailfrom: raj.khem@gmail.com) Received: by mail-qk1-f172.google.com with SMTP id z11so2931750qkj.7 for ; Fri, 18 Dec 2020 10:47:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=1Lqxs0tqZD7gbQstUYlmVqiD/z/7lLGICRPcZVWnuAM=; b=T13AvDJwM9Oy33FRPqs3kgBWtGaa7OvDcmRDls1yHkrI8lgA2r5E6Tlc2gv8zf+M2e 6+elUCG99tedWr2tNhoUeqd5W67mlSYAlgedqCMXG563JpmaxgZV/86AQV74/Vw/+Pmc JQKe/kk1IFx4pOAGA2MHDyMvjqDpoP5eO9lAYn4Oq92pLq2URSc+ZihhnyfRYWuZe6gq MasyEaNDvIWHCD08+QONAwwgtPF1Fnj6cnNWqFeo/z210OznYGy07iELKpeSZYP7aMyw eW2VTbZWbcjCPAdJVmWVdgWzuw3gqjggxoLNHkkpEpVO7UhNlqKvB6vjzXB1BTOGCFqP 4dMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1Lqxs0tqZD7gbQstUYlmVqiD/z/7lLGICRPcZVWnuAM=; b=CY67osOZJcuTuKdbrQ2pAYp/K/0P4yDj41ZGZ9IqJvbHgl+2VG1v7cNYGAtSR3t9Vb IR66T7nHu0T8p7lzMYjo8LwJR4WV+/d54pK3NlteQisEKrHu68CO9BLkjFdAJq/w5d1R YuV70peEjFLPSdAgfAe+fUTkSL/441sShCWHzxq6BOOI75pA/hSkG2owq8D5Zdua46Bj baGRp0ZD2J7LiptKH5U04v7RY4OSXltJDIP+k/pGTStKmRUu3YCYzqJJviWTFkiTdZV8 /9qLuRGCDjixfhlcpq6LZ3eWQNUDHGQD+V+aqu2BzYtxmFatM3rSsTQSscY2xNqP6+DP VbhQ== X-Gm-Message-State: AOAM530bP0/v5287t4gGDkS2Z+T3XH1goYMLsVBndxMguhcomtSplfv4 o6KlVDpaTNAG4oiImGuAEC0YPPhXREwmQ9nKNRU= X-Google-Smtp-Source: ABdhPJxuntarWQa+isuDwtXN4pU18IoUH7VwCjXpGTjn7daqa9wLp3U3EswZA/La93DAc7lsw7NqGYtYl6CmTX169ro= X-Received: by 2002:a37:b182:: with SMTP id a124mr6287812qkf.9.1608317226341; Fri, 18 Dec 2020 10:47:06 -0800 (PST) MIME-Version: 1.0 References: <20201217225440.2633474-1-raj.khem@gmail.com> <20201217225440.2633474-4-raj.khem@gmail.com> In-Reply-To: From: "Khem Raj" Date: Fri, 18 Dec 2020 10:46:55 -0800 Message-ID: Subject: Re: [OE-core] [PATCH 4/4] initscripts: Use initctl on sysvinit only To: Sinan Kaya Cc: openembedded-core@lists.openembedded.org Content-Type: multipart/alternative; boundary="000000000000f65caa05b6c188a5" --000000000000f65caa05b6c188a5 Content-Type: text/plain; charset="UTF-8" On Fri, Dec 18, 2020 at 10:29 AM Sinan Kaya wrote: > On 12/17/2020 5:54 PM, Khem Raj wrote: > > +if [ ! -p "$INITCTL" ] && [ "$(readlink -- "/sbin/init")" = > "/sbin/init.sysvinit" ]; then > > Can this be done at build time for targets using sysvinit only? > Yes however It will be lot more obscure Hard to read and harder to maintain > > > + # Create new control channel > > + rm -f "$INITCTL" > > + mknod -m 600 "$INITCTL" p > > + > > + # Reopen control channel. > > + PID="$(pidof -s /sbin/init || echo 1)" > > + [ -n "$PID" ] && kill -s USR1 "$PID" > > fi > > -kill -USR1 1 > > --000000000000f65caa05b6c188a5 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Fri, Dec 18, 2020 at 10:29 AM Sinan Kaya <okaya@kernel.org> wrote:
On 12/17/2020 5:54 PM, Khem Raj wrote:
> +if [ ! -p "$INITCTL" ] && [ "$(readlink -- &qu= ot;/sbin/init")" =3D "/sbin/init.sysvinit" ]; then

Can this be done at build time for targets using sysvinit only?

Yes however It w= ill be lot more obscure=C2=A0
Hard to read and harde= r to maintain=C2=A0

> +=C2=A0 =C2=A0 # Create new control channel
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0rm -f "$INITCTL&= quot;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0mknod -m 600 "$I= NITCTL" p
> +
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0# Reopen control chan= nel.
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0PID=3D"$(pidof -= s /sbin/init || echo 1)"
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[ -n "$PID"= ] && kill -s USR1 "$PID"
>=C2=A0 fi
> -kill -USR1 1

--000000000000f65caa05b6c188a5--