6 ms·
I would bet on the issue being in the init script itself rather than squid. (I'm assuming squid doesn't run as root by default in rhel) If that's true then it's
by viraptor 12y ago
I would bet on the issue being in the init script itself rather than squid. (I'm assuming squid doesn't run as root by default in rhel) If that's true then it's another point for more sane process managers (upstart/supervisord/systemd/...)
- 4ad 12y agoRHEL uses systemd.
- bonzini 12y agoThis is RHEL6.7, it doesn't use systemd.
- 4ad 12y agoOh, I see.
- Xylakant 12y agoSpecifically, this bug would not have happened with systemd since systemd does not leave the handling of pid-files and pid-dirs to shell-scripts.
- marcosdumay 12y agoThat normally does not happen when handling pid-dirs, simply because those are standard and can be handled with standard tools. Every time I've seen such a bug (honestly, not many), it was created when cleaning a temporary dir.
- bandrami 12y agoNo, but if an analogous bug happened (systemd forgot to set an internal squidroot variable before clearing the squidroot, for instance), it would be much, much harder to figure out what was going on. Which is really what everybody's complaints boil down to.
- blueskin_ 12y ago"systemd" and "sane" only ever go in the same sentence as "sane people don't use systemd". It looks like a bug in the init script; runnign it as squid's user wouldn't have triggered destroying the whole filesystem; likely just squid's config and anything under its /var.
- viraptor 12y agoI'll be the first to call out systemd for a lot of things, but not its core init idea. It's the same as daemontools, upstart, supervisord, and others do. Implementation is very different of course, but the idea is common - you run/kill services, not start/stop them. That's the reason we can leave the ugly and error-prone init scripts behind.
- jdub 12y ago"systemd" and "sane" only ever go in the same sentence as "sane people don't use systemd". It looks like a bug in the init script... Ha ha ha ha ha ha ha.
- MichaelGG 12y agoI hear people complaining, but why has every distro picked it up then? If it's so insane, why are these people all converging on it?
- digi_owl 12y agoDevs love it (in particular web service/app/buzzword-off-the-day devs), admins (at least those not in charge of "cattle") loath it. This because what it provides it rapid spin up of containers and VMs, while everything talks to each other via APIs and DBUS. But this rapidity also leads to issues with field repairs and debugging. "Everyone" is adopting it because the Linux money is in web servers/services.
- koenigdavidmj 12y ago> It looks like a bug in the init script Which is what happens when you have every daemon writing their own PID handling code, running as root, in a language whose interpolation rules nobody really understands.
- kevan 12y agoAgreed, I should've elaborated. All it takes is something like this in the init script without checking if the variable is empty: rm -rf "$STEAMROOT/"*
- deleted 12y ago[deleted]
- a13xb 12y agoI feel like it would be a frighteningly common bug. I remember one like this from 2011 [1]. Install/packaging/utility scripts usually do not get as much attention and testing as the application code itself. [1] https://github.com/MrMEEE/bumblebee-Old-and-abbandoned/issues/123 https://github.com/MrMEEE/bumblebee-Old-and-abbandoned/issue...
- userbinator 12y agoI'd say the fact that these bugs only very occasionally happen - relative to the huge number of shell scripts out there that are being executed every day - that it's not really "frighteningly common". You only hear about the ones that fail.
- MichaelGG 12y agoBy the same logic, memory safety issues only happen rarely, right? Most programs/scripts are going to be tested if part of a distribution and such errors removed. But without polling people it'd be hard to know of the many times this kinda thing messed things up. I personally wiped out a production DB due to expanding an unset variable (fortunately immediately after taking a backup.
- DSMan195276 12y agoThat's not completely true. At least with the GNU tools, 'rm' won't delete the root directory unless you specifically give it the '--no-preserve-root' flag. Since that flag has no use outside of deleting root, it's unlikely it has the flag on it. With that in mind the script must do some type of manual deleting for some reason.
- SwellJoe 12y agoThis is, as the bug notes, a regression, and I'm guessing you're right about it being in the initscript (I'm pretty sure). I used to be a very heavy Squid user and Squid developer and I remember a very similar bug many years ago. It was in the cache_dir initialization code. It would read the configuration file, parse out the cache_dir lines, and if the directories didn't exist it would create them as part of the startup. There were some circumstances where if there was no cache_dir line configured, or if the cache_dir was a link or something, the details are very sketchy in my mind after so much time, but it would end up destroying /. I'm guessing this is of that same nature.