Discussion:
Slackware 15 stucks
(too old to reply)
Milky
2021-05-06 12:47:11 UTC
Permalink
Hello again!

I wrote about over year ago about the same proplem ? I have a Fujitsu
Lifebook E744 with latest UEFI update (v.1.37 Phoenix). And it stucks
when I boot Slackware64-current-DVD.iso from my USB stick (USB 3.0 16
GB Transcend). I have tried both UEFI ja CMS mode and in both stucks
to keybord selection ? And both kernel options in boot (GRUB) menu ?
Don't have a DVD-drive in my computer that could try to boot from it.
Also tried out older versions of Slackware with same effect. Can any-
thing be done or should I forget Slackware ?


Thanks!


--Milky--
Milky
2021-05-06 13:07:13 UTC
Permalink
 Hello again!
I wrote about over year ago about the same proplem ? I have a Fujitsu
Lifebook E744 with latest UEFI update (v.1.37 Phoenix). And it stucks
when I boot Slackware64-current-DVD.iso from my USB stick (USB 3.0 16
GB Transcend). I have tried both UEFI ja CMS mode and in both stucks
to keybord selection ? And both kernel options in boot (GRUB) menu ?
Don't have a DVD-drive in my computer that could try to boot from it.
Also tried out older versions of Slackware with same effect. Can any-
thing be done or should I forget Slackware ?
Runs well on Oracle VirtualBox. Or should I be satisficed to run it
on virtualmachine ??


--Milky-
greymaus
2021-05-08 10:46:55 UTC
Permalink
Post by Milky
Hello again!
I wrote about over year ago about the same proplem ? I have a Fujitsu
Lifebook E744 with latest UEFI update (v.1.37 Phoenix). And it stucks
when I boot Slackware64-current-DVD.iso from my USB stick (USB 3.0 16
GB Transcend). I have tried both UEFI ja CMS mode and in both stucks
to keybord selection ? And both kernel options in boot (GRUB) menu ?
Don't have a DVD-drive in my computer that could try to boot from it.
Also tried out older versions of Slackware with same effect. Can any-
thing be done or should I forget Slackware ?
Thanks!
--Milky--
What does `stucks' mean?

I have installed Slack*15 to an old Thinkpad laptop with no problem. UEFI is a
pain in the ass.
Milky
2021-05-09 14:21:03 UTC
Permalink
Post by greymaus
What does `stucks' mean?
I have installed Slack*15 to an old Thinkpad laptop with no problem. UEFI is a
pain in the ass.
Is hang a better word in the English ? No problem with any other...


--Milky--
John McCue
2021-05-10 00:52:50 UTC
Permalink
Post by Milky
Post by greymaus
What does `stucks' mean?
I have installed Slack*15 to an old Thinkpad laptop
with no problem. UEFI is a pain in the ass.
Is hang a better word in the English ? No problem with any other...
Yes, hang or froze (or frozen). I thought you said
'sucks' and was ignoring the post. I guess I am jaded
from being on usenet too long :) I will reread your
post and see what you are asking.

Btw 'stuck' without the 's' would have been OK too.
Post by Milky
--Milky--
John
eho
2021-05-12 02:58:27 UTC
Permalink
Post by greymaus
Post by Milky
Hello again!
I wrote about over year ago about the same proplem ? I have a Fujitsu
Lifebook E744 with latest UEFI update (v.1.37 Phoenix). And it stucks
when I boot Slackware64-current-DVD.iso from my USB stick (USB 3.0 16
GB Transcend). I have tried both UEFI ja CMS mode and in both stucks
to keybord selection ? And both kernel options in boot (GRUB) menu ?
Don't have a DVD-drive in my computer that could try to boot from it.
Also tried out older versions of Slackware with same effect. Can any-
thing be done or should I forget Slackware ?
Thanks!
--Milky--
What does `stucks' mean?
I have installed Slack*15 to an old Thinkpad laptop with no problem.
UEFI is a pain in the ass.
I too installed Current on several machines without problem, not using UEFI
but legacy and plain old lilo with ALMOST no problems.

Milky could you please post the last lines you see when the install hangs?

Once in the last weeks while installing Current the install SEEMED to hang
at a certain moment. When you start the setup program, you are in a
dialog display, and you are asked to install the software from a medium,
be it DVD or USB. Then you choose USB and the install process begins.

By default, the packages in the install process are displayed in a line
one by one. In my case at the end of this process, the display froze,
or hang. All I had to do was to enter "exit", and everything went fine.

Could it be something like that?

Cheers, Erich

ps. Did you consider bying an extern dvd drive? It is not that expensive,
but comes in handy sometimes...
--
c·o·m·p·e·l·l·e·i·n·t·r·a·r·e·at·p·o·s·t·e·o·.·m·e
Milky
2021-05-14 13:33:25 UTC
Permalink
eho kirjoitti 12.5.2021 klo 5.58
Post by eho
I too installed Current on several machines without problem, not using UEFI
but legacy and plain old lilo with ALMOST no problems.
Milky could you please post the last lines you see when the install hangs?
Once in the last weeks while installing Current the install SEEMED to hang
at a certain moment. When you start the setup program, you are in a
dialog display, and you are asked to install the software from a medium,
be it DVD or USB. Then you choose USB and the install process begins.
By default, the packages in the install process are displayed in a line
one by one. In my case at the end of this process, the display froze,
or hang. All I had to do was to enter "exit", and everything went fine.
Could it be something like that?
Cheers, Erich
Last one before it hang is: Enter 1 to select a keybord map. There it
hangs ? Tried out also in legacy mode (CSM) and both kernel options
in GRUB menu but it hangs?
Post by eho
ps. Did you consider bying an extern dvd drive? It is not that expensive,
but comes in handy sometimes...
Yes, sure! I'm considering that!


--Milky--

PS. Tried out Current ISO file (14-5-2021).
John Forkosh
2021-05-15 03:42:24 UTC
Permalink
Post by Milky
eho kirjoitti 12.5.2021 klo 5.58
Post by eho
Milky could you please post the last lines you see
when the install hangs?
Last one before it hang is: Enter 1 to select a keybord map.
There it hangs ? Tried out also in legacy mode (CSM)
and both kernel options in GRUB menu but it hangs?
Yeah, I have exactly the same problem; at least it hangs at
exactly the same place. Prints that "Enter 1..." message and hangs.
My box is an Asus VivoPC VM62N-G050R (purchased April 2015).

Weird thing is, I initially installed 14.1 from an external/usb
dvd drive, dual-booting with the pre-installed win8.1, and
everything worked perfectly, with elilo creating a new EFI
partition Slackware directory, etc, etc. And I happily ran
slackware for several years after that. No problems.

Then the weirdness... One day it went directly into the bios,
and the boot menu showed nothing. I'd had the small pc mounted
vertically behind a monitor, and it turned out the hard disk
was hanging from its sata connector, and had eventually worked
loose. No big problem...or so I thought. Re-seated the disk
(and put a makeshift shim in place to keep it seated).
But then it booted directly into win8.1. So I re-booted into
the bios, but now its boot screen only showed win, no slackware.

I was, and still am, able to boot usb sticks, one with gparted
and another with an arch-based "rescue system". And the EFI
partition looked fine to me, with its slackware directory
intact as far as I could tell. After several (actually many)
additional failed slackware boot attempts, I finally decided
to re-install from scratch. But now it hung at that "Enter 1...".

I tried several other releases, old dvd's from my external
drive, and newer ones I'd downloaded directly on a usb flash
drive (and which I'd successfully used on other boxes).
Same result every single time. So, guessing the EFI partition
was somehow corrupted, I swapped the original disk for a spare
sata drive I had lying around after reformatting it so it
was entirely clean. Same result. Then I tried removing the
hard disk entirely and booting the slackware install stick.
Same result.

The only guess left to me was that somehow the bios settings
had been mangled in some way that now prevented slackware,
but not other distros, from booting: the gparted and
"rescue system" sticks both booted without any problem.
And after intensive examination of the bios settings,
and numerous trials flipping them around, nothing worked.

So I downloaded an ubuntu iso onto a usb stick, and tried that
back on the original disk. Installed perfectly, without a single
hitch or slightest hiccup, and that's been dual-booting with
win8.1 ever since. Every once in a while I think I get an idea
and try booting a slackware install stick. But still no luck.

So, to repeat weird/goofy bottom line: slackware originally
installed and dual-booted with win8.1 just fine. But then
the disk accidentally worked loose from its sata connector.
And afterwards, the bios no longer recognized slack's EFI
image as a boot option, and re-install attempts hang at that
same "Enter 1..." message, exactly like you said.
--
John Forkosh ( mailto: ***@f.com where j=john and f=forkosh )
Milky
2021-05-15 13:00:54 UTC
Permalink
Post by eho
ps. Did you consider bying an extern dvd drive? It is not that expensive,
but comes in handy sometimes...
I think that I'm gonna buy some external drive soon? Should I spent
some more money and buy Blue-Ray drive allready ? This laptop allready
has a DVD place. It's for ATAPI DVD-drive. I think that ATAPI-drives
can't find new ones anymore , only used ? Earlier I had A DVD drive
in this machine. But it got broken. Not only for that I can install
Slackware. I have DVD disks. Now I have Fedora 34 GNOME and also Win
10 in my SSD. This fedora is good!
Milky
2021-05-26 11:45:38 UTC
Permalink
  I think that I'm gonna buy some external drive soon? Should I spent
  some more money and buy Blue-Ray drive allready ? This laptop allready
  has a DVD place. It's for ATAPI DVD-drive. I think that ATAPI-drives
  can't find new ones anymore , only used ? Earlier I had A DVD drive
  in this machine. But it got broken. Not only for that I can install
  Slackware. I have DVD disks. Now I have Fedora 34 GNOME and also Win
  10 in my SSD. This fedora is good!
Odered an ASUS BW-16D1H-U PRO Bluray external drive. BTW its Bluray
not BlueRay as I wrote earlier. Was not very cheap. Over 140 €. Hope
that will work O.K with Linux ? Now I have Garuda Linux. And see if
it boots allright with Slackare ? Waiting when it comes to mail
office....
Milky
2021-05-28 15:48:18 UTC
Permalink
   I think that I'm gonna buy some external drive soon? Should I spent
   some more money and buy Blue-Ray drive allready ? This laptop allready
   has a DVD place. It's for ATAPI DVD-drive. I think that ATAPI-drives
   can't find new ones anymore , only used ? Earlier I had A DVD drive
   in this machine. But it got broken. Not only for that I can install
   Slackware. I have DVD disks. Now I have Fedora 34 GNOME and also Win
   10 in my SSD. This fedora is good!
    Odered an ASUS BW-16D1H-U PRO Bluray external drive. BTW its Bluray
    not BlueRay as I wrote earlier. Was not very cheap. Over 140 €. Hope
    that will work O.K with Linux ? Now I have Garuda Linux. And see if
    it boots allright with Slackare ? Waiting when it comes to mail
    office....
I got the drive from local post office today. It's now on an USB
3.0 port. Tried to boot from Current ISO (the latest) and it
hangs to "select keybord" ? I had an old DVD with Slackware 14.1
and that makes the same. DVD-disk are Maxell DVD +WR 4x speed.
Everyting other works fine. UEFI recognize drive as a DVD/CD
drive. Linux also recognize as a DVD/CD drive. Can boot also at
the drive. Gotta use this Garuda Linux with Gnode desktop ??


--Milky--
Milky
2021-05-29 14:45:37 UTC
Permalink
       I got the drive from local post office today. It's now on an USB
       3.0 port. Tried to boot from Current ISO (the latest) and it
       hangs to "select keybord" ? I had an old DVD with Slackware 14.1
       and that makes the same. DVD-disk are Maxell DVD +WR 4x speed.
       Everyting other works fine. UEFI recognize drive as a DVD/CD
       drive. Linux also recognize as a DVD/CD drive. Can boot also at
       the drive. Gotta use this Garuda Linux with Gnode desktop ??
Some corrections: Should be DVD-disks not DVD-disk. And the
desktop is of course GNOME. But get back to Fedora 34 GNOME.
Also tried out of those old DVD-disk and they give errors
when ckecked out. And they are only 4x speed. Pretty slow.
Gotta get new disks. Probably some Blu-Ray disks and may be
some DVD disks ? Also tested USB stick with Slackware 15 on
my mom's Acer Aspire laptop (also UEFI) and it works O.K.
except the display was not good. But it boots up! Look like
it have something uncompatible in this Fujitsu laptop ??


--Milky--
John McCue
2021-05-10 00:59:07 UTC
Permalink
Post by Milky
Hello again!
I wrote about over year ago about the same proplem ? I have a Fujitsu
Lifebook E744 with latest UEFI update (v.1.37 Phoenix).
Never heard of this hardware, but is there an option
to select non-UEFI boot (like legacy) ?

Note if you have Windows on it and want to keep it,
doing that will break Windows.

Maybe this will help if you have not already seen it:

https://docs.slackware.com/howtos:slackware_admin:installing_on_uefi_hardware

<snip>
John
Javier
2021-05-16 00:13:30 UTC
Permalink
Post by Milky
I wrote about over year ago about the same proplem ? I have a Fujitsu
Lifebook E744 with latest UEFI update (v.1.37 Phoenix). And it stucks
when I boot Slackware64-current-DVD.iso from my USB stick (USB 3.0 16
GB Transcend). I have tried both UEFI ja CMS mode and in both stucks
to keybord selection ? And both kernel options in boot (GRUB) menu ?
Don't have a DVD-drive in my computer that could try to boot from it.
Also tried out older versions of Slackware with same effect. Can any-
thing be done or should I forget Slackware ?
You can try with an USB stick from system rescue CD.

https://osdn.net/projects/systemrescuecd/storage/releases/5.3.2/systemrescuecd-x86-5.3.2.iso

From System Rescue CD you can do the partitioning yourself with
cfdisk, format it with mkfs.ext3 or mkfs.ext4 with and mount the
directory and copy the packages to that directory.

Slackware is so simple that it's possible to install it even without chrooting.
This does the installing from the shell instead of relying from the
slackware installation media.

It lacks the installation of lilo, but you can rely on SystemRescue CD
to boot a Slackware kernel, and retry the install of the bootloader later.

mkdir -p ${mounted_root_dir}
mount -t ext4 ${TARGET_root} ${mounted_root_dir}
mkdir -p ${mounted_root_dir}/boot
mount -t ext3 ${TARGET_boot} ${mounted_root_dir}/boot

slack_mirror="https://mirrors.slackware.com/slackware"
slack_arch=slackware64
slack_ver=15.0
slack_pkg_dir=/tmp/slack_download/pkgs
slack_kernel_dir=/tmp/slack_download/kernels

# Check again list of packages for 15.0. This is for 14.2
slack_pkgs="${slack_arch}/{a,ap,d,e,f,l,n,t,tcl,x,xap,y}
extra/bash-completion
extra/bittornado
extra/bittorrent
extra/dip-3.3.7p
extra/wicd
extra/xf86-video-fbdev
extra/getty-ps
extra/xv
extra/xfractint
pasture" # firefox, thunderbird, ampd
# kde,kdei,xfce, y (bsdgames), k (kernel src)

mkdir -p ${slack_pkg_dir}
pushd ${slack_pkg_dir}

for i in ${slack_pkgs}; do
wget -m --no-parent --no-host-directories \
${slack_mirror}/${slack_arch}-${slack_ver}/${i}
done
popd

mkdir -p ${slack_kernel_dir}
pushd ${slack_kernel_dir}
wget -m --no-parent \
${slack_mirror}/${slack_arch}-${slack_ver}/${slack_arch}/kernels
popd


cp ${slack_mirror}/${slack_arch}-${slack_ver}/${slack_arch}/kernels/huge.s/bzImage \
${mounted_root_dir}/boot/SLACK_HUGE_bzImage
cp ${slack_mirror}/${slack_arch}-${slack_ver}/${slack_arch}/kernels/huge.s/System.map.gz \
${mounted_root_dir}/boot/SLACK_HUGE_System.map.gz

pkgtools=$(find ${slack_pkg_dir} | grep 'pkgtools-.*z$')

# ${slack_mirror}/${slack_arch}-${slack_ver}/${slack_arch}/a/pkgtools-*.txz
grep -q 'txz$' <<< ${pkgtools_txz}
pushd ${slack_pkg_dir}
tar xJf ${pkgtools_txz}
# ${slack_pkg_dir}/sbin/installpkg
popd

find ${slack_pkg_dir} | grep 't.?z$' | xargs -n 1 \
${slack_pkg_dir}/sbin/installpkg --root ${mounted_root_dir}
Henrik Carlqvist
2021-05-16 19:01:05 UTC
Permalink
On Sat, 15 May 2021 19:13:30 -0500, Javier wrote:

...
Post by Javier
mkdir -p ${slack_pkg_dir}
pushd ${slack_pkg_dir}
for i in ${slack_pkgs}; do
wget -m --no-parent --no-host-directories \
${slack_mirror}/${slack_arch}-${slack_ver}/${i}
done popd
...
Post by Javier
find ${slack_pkg_dir} | grep 't.?z$' | xargs -n 1 \
${slack_pkg_dir}/sbin/installpkg --root ${mounted_root_dir}
I havn't tried to install Slackware without using a more ore less
customized Slackware installation media myself. However, at the end of
the installation a number of configurations are done by running all
scripts in /var/log/setup

Some of the scripts in that directory are interactive, others simply do
what they need to do without any questions asked.

Examples of what those scripts do is to configure the boot loader and
network settings.

regards Henrik
Jimmy Johnson
2021-05-17 02:25:29 UTC
Permalink
Post by Henrik Carlqvist
...
Post by Javier
mkdir -p ${slack_pkg_dir}
pushd ${slack_pkg_dir}
for i in ${slack_pkgs}; do
wget -m --no-parent --no-host-directories \
${slack_mirror}/${slack_arch}-${slack_ver}/${i}
done popd
...
Post by Javier
find ${slack_pkg_dir} | grep 't.?z$' | xargs -n 1 \
${slack_pkg_dir}/sbin/installpkg --root ${mounted_root_dir}
I havn't tried to install Slackware without using a more ore less
customized Slackware installation media myself. However, at the end of
the installation a number of configurations are done by running all
scripts in /var/log/setup
Some of the scripts in that directory are interactive, others simply do
what they need to do without any questions asked.
Examples of what those scripts do is to configure the boot loader and
network settings.
regards Henrik
I found out I messed up a kernel upgrade early this morning, I
multi-boot so I booted mx-linux, it has a chroot gui app, ran it, it's
easy, choose the partition, sda7, click, cd boot and ran the complete
upgrade again, built the initrd, quit chroot, updated legacy grub and
booted the system like there never was a problem. I highly recommend
multi-booting.
--
Jimmy Johnson

Slackware64 Current - AMD A8-7600 - EXT4 at sda7
Registered Linux User #380263
Javier
2021-05-17 19:35:41 UTC
Permalink
Post by Henrik Carlqvist
I havn't tried to install Slackware without using a more ore less
customized Slackware installation media myself. However, at the end of
the installation a number of configurations are done by running all
scripts in /var/log/setup
Some of the scripts in that directory are interactive, others simply do
what they need to do without any questions asked.
Examples of what those scripts do is to configure the boot loader and
network settings.
When I first looked at the internals of the slackware installer it was
hard to me to find the installation scripts.

/var/log/setup is not the most evident place to put some scripts.

hier(7) says:

/var This directory contains files which may change in size, such as
spool and log files.

/var/log
Miscellaneous log files.

I guess Pat put the scripts in /var/log/setup when Slackware began in
the 90s, and later didn't want to change the location for fear of
breaking things (which in most cases is the right thing to do).

Other distros also had those kind of errors that were never corrected.
In the case of Debian comes to my mind the horrible desing of run-parts(1)
or the fact that /tmp is not in RAM.
Lew Pitcher
2021-05-17 19:46:07 UTC
Permalink
Post by Javier
Post by Henrik Carlqvist
I havn't tried to install Slackware without using a more ore less
customized Slackware installation media myself. However, at the end of
the installation a number of configurations are done by running all
scripts in /var/log/setup
Some of the scripts in that directory are interactive, others simply do
what they need to do without any questions asked.
Examples of what those scripts do is to configure the boot loader and
network settings.
When I first looked at the internals of the slackware installer it was
hard to me to find the installation scripts.
/var/log/setup is not the most evident place to put some scripts.
/var This directory contains files which may change in size, such as
spool and log files.
/var/log
Miscellaneous log files.
I guess Pat put the scripts in /var/log/setup when Slackware began in
the 90s, and later didn't want to change the location for fear of
breaking things (which in most cases is the right thing to do).
IIRC, the upcoming 15.0 release moves Pat's setup files to another
location

Ahhh... here it is

Tue Jun 19 22:35:25 UTC 2018
testing/packages/pkgtools-15.0-noarch-20.txz: Rebuilt.
This update is a bit scarier than usual, so we're going to test it here
first and then move it into the main tree in a couple of days if there
are no serious bug reports. It's well-tested here, and works with the
slackpkg that's in -current now, but I don't know about slackpkg+ so that's
another reason to let it cool down here first. The purpose of this update
is to migrate the package database and directories from /var/log to
/var/lib/pkgtools. /var/log was never a good place for this data, as it is
considered by many to be a directory that could be wiped to free up some
space. Originally the package database was in /var/adm, but the FSSTND
(later FHS) group decided that directory should be a symlink to /var/log,
and I went along with that since it was years ago and I was a n00b and didn't
know any better. /var/lib/pkgtools will be a better and safer location.
The removed_packages and removed_scripts directories are really just logs
that aren't actually used for anything - those will remain under /var/log,
but moved into /var/log/pkgtools. Everything under /var/log will be
considered potentially non-permanent by the pkgtools - if any directories or
symlinks disappear from there, the pkgtools will automatically recreate them
as needed. In fact, the migration process will create symlinks from all the
old directory locations to the new ones, so anything that expects the old
locations (including slackpkg, for now) should continue to work. Once this
moves into the main tree, the plan is to fix other packages to use the new
installer script directory (/var/lib/pkgtools/setup) and change the installer
and slackpkg to use the new native locations for everything. When slackpkg
is changed over to use the new native locations, I'll also make sure to float
that in testing/ for a few days before moving it to the main tree to avoid
more unintentional disruption to slackpkg+ users.
Be aware that the package database migration is a one-way operation, but even
so if you later downgrade to an older version of the pkgtools it will still
work through the compatibility symlinks.

and

Thu Jun 21 22:58:42 UTC 2018
a/pkgtools-15.0-noarch-20.txz: Rebuilt.
Move pkgtools database to /var/lib/pkgtools/.
Move removed logs to /var/log/pkgtools/.
Post by Javier
Other distros also had those kind of errors that were never corrected.
In the case of Debian comes to my mind the horrible desing of run-parts(1)
or the fact that /tmp is not in RAM.
--
Lew Pitcher
"In Skills, We Trust"
#Paul
2021-06-07 17:56:35 UTC
Permalink
Post by Javier
or the fact that /tmp is not in RAM.
I'll have you know I have files over 5 years old in /tmp,
and I like it that way :-)

#Paul
Henrik Carlqvist
2021-06-07 19:57:25 UTC
Permalink
Post by #Paul
I'll have you know I have files over 5 years old in /tmp,
and I like it that way :-)
I have added a custom cron script to remove files in /tmp older than 37
days and empty directories not touched in 37 days:

-8<---------------------------------

cat /etc/cron.daily/tmp-clean
#!/bin/sh
# Cleanup /tmp however, do not remove sockets for X

# No lost+found with reiserfs, but ext* has it...
find /tmp/lost+found -exec /bin/touch {} \;
find /tmp -type s -exec /bin/touch {} \;
find /tmp -type d -empty -mtime +37 -exec /bin/rmdir {} \;
find /tmp -atime +37 -exec /bin/rm {} \;

-8<---------------------------------

As the comment says in the script X might crash if sockets like
/tmp/.X11-unix/X0 is removed so the script starts by touching all sockets
to make sure that they are not removed.

regards Henrik
Grant Taylor
2021-06-08 22:37:35 UTC
Permalink
Post by Henrik Carlqvist
-8<---------------------------------
#!/bin/sh
# Cleanup /tmp however, do not remove sockets for X
# No lost+found with reiserfs, but ext* has it...
find /tmp/lost+found -exec /bin/touch {} \;
find /tmp -type s -exec /bin/touch {} \;
find /tmp -type d -empty -mtime +37 -exec /bin/rmdir {} \;
find /tmp -atime +37 -exec /bin/rm {} \;
-8<---------------------------------
Drive by comment: Be careful with filenames with spaces in them. I'd
suggest putting double quotes around the {} in the find -exec statements.
--
Grant. . . .
unix || die
Lew Pitcher
2021-06-08 23:06:09 UTC
Permalink
Post by Grant Taylor
Post by Henrik Carlqvist
-8<---------------------------------
#!/bin/sh
# Cleanup /tmp however, do not remove sockets for X
# No lost+found with reiserfs, but ext* has it...
find /tmp/lost+found -exec /bin/touch {} \;
find /tmp -type s -exec /bin/touch {} \;
find /tmp -type d -empty -mtime +37 -exec /bin/rmdir {} \;
find /tmp -atime +37 -exec /bin/rm {} \;
-8<---------------------------------
Drive by comment: Be careful with filenames with spaces in them. I'd
suggest putting double quotes around the {} in the find -exec statements.
GNU find(1) extends POSIX find(1) with a "-delete" action that does not
require exposing filenames to the shell. As such, it offers an alternative
to the OP's
find /tmp -atime +37 -exec /bin/rm {} \;
in
find /tmp -atime +37 -delete

For added security, I would rephrase the command to:
find /tmp -atime +37 -print -delete
to keep a record of files and directories deleted.
--
Lew Pitcher
"In Skills, We Trust"
Rich
2021-06-09 00:43:06 UTC
Permalink
Post by Lew Pitcher
Post by Grant Taylor
Post by Henrik Carlqvist
-8<---------------------------------
#!/bin/sh
# Cleanup /tmp however, do not remove sockets for X
# No lost+found with reiserfs, but ext* has it...
find /tmp/lost+found -exec /bin/touch {} \;
find /tmp -type s -exec /bin/touch {} \;
find /tmp -type d -empty -mtime +37 -exec /bin/rmdir {} \;
find /tmp -atime +37 -exec /bin/rm {} \;
-8<---------------------------------
Drive by comment: Be careful with filenames with spaces in them. I'd
suggest putting double quotes around the {} in the find -exec statements.
GNU find(1) extends POSIX find(1) with a "-delete" action that does not
require exposing filenames to the shell. As such, it offers an alternative
to the OP's
find /tmp -atime +37 -exec /bin/rm {} \;
in
find /tmp -atime +37 -delete
find /tmp -atime +37 -print -delete
to keep a record of files and directories deleted.
The -exec option to find, using the ; terminator, also forks and
executes the command specified ones per filename found. That can be
avoided by using the + terminator "-exec /bin/rm {} +" instead, but I
prefer to pipe through xargs instead:

find /tmp -atime +37 -print0 | xargs -0 /bin/rm

With either the "+" or the xargs variant, only enough fork()/exec()'s
to delete all the found filenames are executed, instead of one for each
individual file.

Also, depending on disk seek performance (i.e., ssd vs mechanical disk)
the find pipe to xargs could very well run in parallel. The
fork()/exec() variant is either finding files, or deleting them, but
not both at the same time.
Grant Taylor
2021-06-09 03:18:13 UTC
Permalink
I think both Lew's and Rich's comments are on target and very good.
--
Grant. . . .
unix || die
Henrik Carlqvist
2021-06-09 20:52:55 UTC
Permalink
Post by Lew Pitcher
Post by Henrik Carlqvist
-8<---------------------------------
#!/bin/sh
# Cleanup /tmp however, do not remove sockets for X
# No lost+found with reiserfs, but ext* has it...
find /tmp/lost+found -exec /bin/touch {} \;
find /tmp -type s -exec /bin/touch {} \;
find /tmp -type d -empty -mtime +37 -exec /bin/rmdir {} \;
find /tmp -atime +37 -exec /bin/rm {} \;
-8<---------------------------------
find /tmp -atime +37 -print -delete
to keep a record of files and directories deleted.
Thanks for all comments!

I will try:

find /tmp/lost+found -exec /bin/touch {} \;
find /tmp -type s -exec /bin/touch {} \;
find /tmp -type d -empty -mtime +37 -print -delete
find /tmp -atime +37 -print -delete

The record of deleted files will end up in emails to me. As this cron job
is being run on 50+ machines it will probably mean 50+ emails every
night. I might remove the -print if it gets too much to read...

regards Henrik
Grant Taylor
2021-06-10 00:19:37 UTC
Permalink
Post by Henrik Carlqvist
The record of deleted files will end up in emails to me. As this cron
job is being run on 50+ machines it will probably mean 50+ emails
every night. I might remove the -print if it gets too much to read...
(Pro)Tip: Have one string of text for success and another string of
text for failure. Then configure email client filtering to mark success
messages as read (and file them away). That way you can easily look at
the folder and see that the cron job is running like it should be. If
there ever is a failure, it will remain unread (maybe filed away, maybe
not) so that it will garner your attention to investigate the failure.

I've learned that it's really difficult to tell from afar if a
completely silent script is always succeeding or simply not running. I
dislike that.
--
Grant. . . .
unix || die
Henrik Carlqvist
2021-06-10 05:18:47 UTC
Permalink
Post by Grant Taylor
I've learned that it's really difficult to tell from afar if a
completely silent script is always succeeding or simply not running. I
dislike that.
Thanks, yes, I share that experience. During the years it has happened
that the crond daemon has died completely. Fortunately all those machines
are also monitored by software which will tell if some important deamon
has died and/or if some partition is getting more than 90% full. I have
/tmp on a separate partition.

regards Henrik

Richard Kettlewell
2021-06-09 08:55:53 UTC
Permalink
Post by Henrik Carlqvist
-8<---------------------------------
#!/bin/sh
# Cleanup /tmp however, do not remove sockets for X
# No lost+found with reiserfs, but ext* has it...
find /tmp/lost+found -exec /bin/touch {} \;
find /tmp -type s -exec /bin/touch {} \;
find /tmp -type d -empty -mtime +37 -exec /bin/rmdir {} \;
find /tmp -atime +37 -exec /bin/rm {} \;
-8<---------------------------------
Drive by comment: Be careful with filenames with spaces in them. I'd
suggest putting double quotes around the {} in the find -exec
statements.
That’s not how shell quoting or find -exec work.

The real problem with these commands is that they contain a well-known
vulnerability. For details see:

https://www.gnu.org/software/findutils/manual/html_node/find_html/Race-Conditions-with-_002dexec.html
--
https://www.greenend.org.uk/rjk/
Grant Taylor
2021-06-09 15:07:08 UTC
Permalink
Post by Richard Kettlewell
That’s not how shell quoting or find -exec work.
Please elaborate.
Post by Richard Kettlewell
The real problem with these commands is that they contain a well-known
I completely agree that there is a timing component (race condition)
that can be a problem. But that's not the component I was speaking to.
--
Grant. . . .
unix || die
Richard Kettlewell
2021-06-09 17:00:58 UTC
Permalink
Post by Grant Taylor
Post by Richard Kettlewell
That’s not how shell quoting or find -exec work.
Please elaborate.
I have too much RSI to repeat shell-quoting rules and the semantics of
find -exec. You will have to look them up.
--
https://www.greenend.org.uk/rjk/
Eli the Bearded
2021-06-09 18:44:01 UTC
Permalink
Drive by comment: Be careful with filenames with spaces in them. I'd
suggest putting double quotes around the {} in the find -exec
statements.
That's not how shell quoting or find -exec work.
Agreed. Note that I'm using ksh and have PS2 set to <TAB> here:

$ cd /var/tmp
$ mkdir 'I
U+2665
trouble' && cd I*trouble
$ mkdir '`echo nana`'
$ touch '`echo nana`'/'
yikes
'
$ cd ..
$ find . -size 0 -type f -exec ls -ld {} +
-rw-rw-r-- 1 username username 0 Jun 9 11:35 './I'$'\n''U+2665'$'\n''trouble/`echo nana`/'$'\n''yikes'$'\n'
$

Since I'm using ksh, {} is not special to shell, and does not need
quoting. Since {} is safely replaced by find, whitespace and shell
metas in names is not an issue.

Elijah
------
did not actually include the unicode, just the U+codepoint
Loading...