public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Henning Schild <henning.schild@siemens.com>
To: "Roberto A. Foglietta" <roberto.foglietta@gmail.com>
Cc: isar-users@googlegroups.com
Subject: Re: [PATCH v2] If expand last partition fails, unsupervised systems reboot
Date: Wed, 14 Dec 2022 10:05:28 +0100	[thread overview]
Message-ID: <20221214100528.0386e83b@md1za8fc.ad001.siemens.net> (raw)
In-Reply-To: <20221214094707.006cf073@md1za8fc.ad001.siemens.net>

Am Wed, 14 Dec 2022 09:47:07 +0100
schrieb Henning Schild <henning.schild@siemens.com>:

> Patch can not be reviewed so i can as well top-post.
> 
> We should maybe separate the discussion with the reboot trap and the
> unsupervised file from the "aligning the nothing to do exit code to 0"

I think it might also be a good idea to set

ExecStopPost=-/bin/systemctl disable expand-on-first-boot.service

in addition to ExecStartPost doing the same. So no matter if we succeed
or not, we only give it one try. But i did not test that.

Henning

> And i think we can only really have the discussion if the patches are
> inline and not attached.
> 
> Good catch, please send a patch that just turns that exit 1 into an
> exit 0. Ideally without elastically stretching git send-email workflow
> rules.
> 
> Henning 
> 
> Am Wed, 14 Dec 2022 08:52:00 +0100
> schrieb "Roberto A. Foglietta" <roberto.foglietta@gmail.com>:
> 
> > Hi all,
> > 
> >  in the expand last partition script I read this code
> > 
> > ROOT_DEV="$(findmnt / -o source -n)"
> > [...]
> > BOOT_DEV="$(echo "${ROOT_DEV}" | sed 's/p\?[0-9]*$//')"
> > if [ "${ROOT_DEV}" = "${BOOT_DEV}" ]; then
> >         echo "Boot device equals root device - no partitioning
> > found"  
> > >&2 trap - EXIT  
> >         exit 1
> > fi
> > 
> > this means that there are no partitions because the boot partition
> > /dev/sda is equal to root partition /dev/sda, which happens only
> > when there is no partition table.
> > 
> > roberto$ echo /dev/sda2 | sed 's/p\?[0-9]*$//'
> > /dev/sda (which is different than /dev/sda2)
> > roberto$ echo /dev/sda | sed 's/p\?[0-9]*$//'
> > /dev/sda (there is no partition table)
> > 
> > That's ok but not exit 1 because IMHO, it will retry again the next
> > time but nothing will change the next time so it will continue to
> > try and fail at every boot. Because one-time-only in systemd means
> > one-successful-time-only and exit 1 prevents disabling the
> > operation.
> > 
> > So, exit 0 would be the correct code to execute and this is the
> > reason because I removed the trap which would make an unsupervised
> > system reboot.
> > 
> > The patch v2 has been sent using the elastic mail SMTP and went in
> > moderation, here in attachment.
> > 
> > Best regards, R-
> >   
> 


  reply	other threads:[~2022-12-14  9:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-14  7:52 Roberto A. Foglietta
2022-12-14  8:47 ` Henning Schild
2022-12-14  9:05   ` Henning Schild [this message]
2022-12-14  9:24     ` Roberto A. Foglietta
2022-12-14  9:26 ` Roberto A. Foglietta

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221214100528.0386e83b@md1za8fc.ad001.siemens.net \
    --to=henning.schild@siemens.com \
    --cc=isar-users@googlegroups.com \
    --cc=roberto.foglietta@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox