| Message ID | 6c55f0b1-e991-41a4-a98b-ca387bb37f6c@ipfire.org |
|---|---|
| State | New |
| Headers |
Return-Path: <development-bounces@lists.ipfire.org> Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature ECDSA (secp384r1)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4W2FxH2xspz3wnw for <patchwork@web04.haj.ipfire.org>; Sun, 16 Jun 2024 14:38:11 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384 client-signature ECDSA (secp384r1) client-digest SHA384) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4W2FxD2Vssz128; Sun, 16 Jun 2024 14:38:08 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4W2FxD0zVpz32mV; Sun, 16 Jun 2024 14:38:08 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384 client-signature ECDSA (secp384r1) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4W2Fx94K5xz32mV for <development@lists.ipfire.org>; Sun, 16 Jun 2024 14:38:05 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4W2Fx715K4z128 for <development@lists.ipfire.org>; Sun, 16 Jun 2024 14:38:02 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1718548685; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZvaPYr64cAb18VQOYUHGBPjHMPnVG7ttfyr58mkXX3c=; b=4a9SLV2C9Lx/vw/vNOIbY4zcRTfDiR2BixHRvuY3b3Pudd4U8LMpZdNLAOHMNoLlEb/lB0 yqf/ZdkQvreW2vAQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1718548685; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZvaPYr64cAb18VQOYUHGBPjHMPnVG7ttfyr58mkXX3c=; b=qe0jAxlW3Ox1E1XsyDcTmleove5uBDXEZbsZIKCcnT3tSVB2YN13eV4CP7cf4ORdmgKlut NR5fITa1D0WwYzRqffZVNIGczh2wDEcCx1vjh0pq+g70n/2mps6H7QX15vx1W4upN9XMwI nkBOnzo6f3HUNO5d/aBMnSvyqgepynBcbm2cmPZuN9P2e76Ta0JScLP56KX4HeoGTf5g1p oLyh+gdaqqpexXI2aL80u3i8eAo/BhIJu7cuGTBvZ3d2kQ3e0rwNshOlGWKEmN+qiqQF/G bQiW8mUWkL6oOhr82TI7zjxfBhuRK6GpBmgg7QDiYMyS8lPwr1+fGqq4X/U2Eg== Message-ID: <6c55f0b1-e991-41a4-a98b-ca387bb37f6c@ipfire.org> Date: Sun, 16 Jun 2024 14:37:00 +0000 MIME-Version: 1.0 To: "IPFire: Development" <development@lists.ipfire.org> From: =?utf-8?q?Peter_M=C3=BCller?= <peter.mueller@ipfire.org> Subject: [PATCH] cleanfs: Clean /home/nobody/ as well Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-ID-Hash: ALLWPZQ2HUDG4NROHINNE3FFOUKR2UFD X-Message-ID-Hash: ALLWPZQ2HUDG4NROHINNE3FFOUKR2UFD X-MailFrom: peter.mueller@ipfire.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: IPFire development talk <development.lists.ipfire.org> Archived-At: <https://lists.ipfire.org/hyperkitty/list/development@lists.ipfire.org/message/ALLWPZQ2HUDG4NROHINNE3FFOUKR2UFD/> List-Archive: <https://lists.ipfire.org/hyperkitty/list/development@lists.ipfire.org/> List-Help: <mailto:development-request@lists.ipfire.org?subject=help> List-Owner: <mailto:development-owner@lists.ipfire.org> List-Post: <mailto:development@lists.ipfire.org> List-Subscribe: <mailto:development-join@lists.ipfire.org> List-Unsubscribe: <mailto:development-leave@lists.ipfire.org> |
| Series |
cleanfs: Clean /home/nobody/ as well
|
|
Commit Message
Peter Müller
16 Jun 2024, 2:37 p.m. UTC
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
---
src/initscripts/system/cleanfs | 3 +++
1 file changed, 3 insertions(+)
Comments
Can I ask why a cd is done in each command? It should not fail but risks
it and it is unnecessary
find /home/nobody/ -mindepth 1 -delete || failed=1
is the same as:
cd /home/nobody/ && find -mindepth 1 -delete || failed=1
The same can be for clearing /tmp which appears to follow.
Nick
On 16/06/2024 15:37, Peter Müller wrote:
> Signed-off-by: Peter Müller<peter.mueller@ipfire.org>
> ---
> src/initscripts/system/cleanfs | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/src/initscripts/system/cleanfs b/src/initscripts/system/cleanfs
> index d1cbb2547..c78703070 100644
> --- a/src/initscripts/system/cleanfs
> +++ b/src/initscripts/system/cleanfs
> @@ -112,6 +112,9 @@ case "${1}" in
> fi
> boot_mesg -n "Cleaning file systems:" ${INFO}
>
> + boot_mesg -n " /home/nobody" ${NORMAL}
> + cd /home/nobody/ && find . -mindepth 1 -delete || failed=1
> +
> boot_mesg -n " /tmp" ${NORMAL}
> cd /tmp &&
> find . -xdev -mindepth 1 ! -name lost+found \
I don't know what happened to the "." in the second command. The message
should read:
find /home/nobody/ -mindepth 1 -delete || failed=1
is the same as:
cd /home/nobody/ && find . -mindepth 1 -delete || failed=1
It would save the cd and the &&.
On 16/06/2024 15:54, Nick Howitt wrote:
> Can I ask why a cd is done in each command? It should not fail but
> risks it and it is unnecessary
>
> find /home/nobody/ -mindepth 1 -delete || failed=1
>
> is the same as:
>
> cd /home/nobody/ && find -mindepth 1 -delete || failed=1
>
>
> The same can be for clearing /tmp which appears to follow.
>
> Nick
>
> On 16/06/2024 15:37, Peter Müller wrote:
>> Signed-off-by: Peter Müller<peter.mueller@ipfire.org>
>> ---
>> src/initscripts/system/cleanfs | 3 +++
>> 1 file changed, 3 insertions(+)
>>
>> diff --git a/src/initscripts/system/cleanfs b/src/initscripts/system/cleanfs
>> index d1cbb2547..c78703070 100644
>> --- a/src/initscripts/system/cleanfs
>> +++ b/src/initscripts/system/cleanfs
>> @@ -112,6 +112,9 @@ case "${1}" in
>> fi
>> boot_mesg -n "Cleaning file systems:" ${INFO}
>>
>> + boot_mesg -n " /home/nobody" ${NORMAL}
>> + cd /home/nobody/ && find . -mindepth 1 -delete || failed=1
>> +
>> boot_mesg -n " /tmp" ${NORMAL}
>> cd /tmp &&
>> find . -xdev -mindepth 1 ! -name lost+found \
>
diff --git a/src/initscripts/system/cleanfs b/src/initscripts/system/cleanfs index d1cbb2547..c78703070 100644 --- a/src/initscripts/system/cleanfs +++ b/src/initscripts/system/cleanfs @@ -112,6 +112,9 @@ case "${1}" in fi boot_mesg -n "Cleaning file systems:" ${INFO} + boot_mesg -n " /home/nobody" ${NORMAL} + cd /home/nobody/ && find . -mindepth 1 -delete || failed=1 + boot_mesg -n " /tmp" ${NORMAL} cd /tmp && find . -xdev -mindepth 1 ! -name lost+found \