You are not logged in.

#1 2020-05-18 00:08:52

mee_me
Member
Registered: 2020-05-17
Posts: 4

[SOLVED] Can't remove a strange 0 byte file in my home directory

Hello,
Before I get to the question, I want to say a few things. I've been using Arch since some point last year (I've since installed it on 3 other computers, and then did a LFS install because I was bored), and am very comfortable with it (not really a newbie), but this is my first time posting on the forum. I hope this is the right place to put this.

Anyways, I have this weird file in my home directory. It only shows up about 50% of the time (to anything, including bash tab completion).
This file has been here for a while, but since I'm switching to an SSD, I'm taking the opportunity to go through and clean up my system first.
As to where it came from, probably me. It might be a link to itself, but it doesn't show up as a link. I was messing around with that when I was bored one day a few months ago. I have no idea why it is named blinkingy.
The reason I haven't posted anything yet is that I'm usually pretty good at searching stuff, but I can't find anything on this. It looks like a few people have had some weirdness with 0 byte files, but not anything like this.
I just want to get rid of it (and maybe figure out where it came from). If I need to copy everything except that file to a new partition (on the SSD when I switch), I can do that. /home/ is a separate partition anyways, but it would be nice to have it out of the way until then. It shows up in errors all the time.

Most of these examples, I retried a few times to get them to work.

[main@archv5 (home) ~]$ ls -l blinkingy
ls: cannot access 'blinkingy': No such file or directory
[main@archv5 (home) ~]$ ls -l blinkingy
-rw-r--r-- 1 main users 0 May 17 16:14 blinkingy

Removing it fails about half the time too, but doesn't actually do anything:

[main@archv5 (home) ~]$ rm blinkingy
[main@archv5 (home) ~]$ ls -l blinkingy
-rw-r--r-- 1 main users 0 May 17 16:20 blinkingy

Moving it fails half the time, but when it doesn't, it just creates an empty file that can be deleted normally.

[main@archv5 (home) ~]$ mv blinkingy blink
[main@archv5 (home) ~]$ ls -l blink*
-rw-r--r-- 1 main users 0 May 17 16:21 blink
-rw-r--r-- 1 main users 0 May 17 16:22 blinkingy
[main@archv5 (home) ~]$ rm blink
[main@archv5 (home) ~]$ ls -l blink*
-rw-r--r-- 1 main users 0 May 17 16:22 blinkingy

I can't put anything in it

[main@archv5 (home) ~]$ echo "hello" > blinkingy
[main@archv5 (home) ~]$ cat blinkingy
cat: blinkingy: No such file or directory
[main@archv5 (home) ~]$ cat blinkingy
[main@archv5 (home) ~]$ ls -l blinkingy
-rw-r--r-- 1 main users 0 May 17 16:25 blinkingy

chmod doesn't work

[main@archv5 (home) ~]$ chmod u+x blinkingy
[main@archv5 (home) ~]$ ls -l blinkingy
-rw-r--r-- 1 main users 0 May 17 16:30 blinkingy

Also, the date and time is always the current date and time.
Any ideas about what this is or how to remove it?

Thanks!

Last edited by mee_me (2020-05-18 01:32:54)

Offline

#2 2020-05-18 01:10:58

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,518
Website

Re: [SOLVED] Can't remove a strange 0 byte file in my home directory

Your very last point - that it's date and time keep progressing - is what I was noting through all the output.

The most parsimonious (not particularly parsimonious, but the most I can fathom) is that some process is continually recreating (and perhaps also removing) the file.  There is nothing odd about a zero byte file - that's what you'd get from `touch filename`.  What seems odd is that you 'rm' it, yet it's still there.  But looking at the timestamp, it's not still there, it's just there again.

If my hypothesis is correct, some process is running that is creating (and perhaps removing) the file at frequent intervals.  So what processes are running?  Can you boot into single user mode and 'rm' it without it immediately reappearing?  What if you boot into a bootable iso, mount the partition, then delete it, does it immediately reappear?  These are not solutions, as if it does not reappear, it almost certainly would when you rebooted into your normal boot target, but these tests could support or reject the hypothesis that a long-running process is maintaining the file.

For example, this script running in the background should readily replicate your symptoms (not that this is what is happening, but similar results as an unintended side effect of another processes):

#!/bin/sh

name=blinkingy

while :; do
	[ -f $name ] && rm $name || touch $name
	sleep $((RANDOM % 5))
done

Last edited by Trilby (2020-05-18 01:14:36)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2020-05-18 01:32:24

mee_me
Member
Registered: 2020-05-17
Posts: 4

Re: [SOLVED] Can't remove a strange 0 byte file in my home directory

You are correct.
I was going to reboot and see if it still would act the same, but I thought about it for a second... if it is repeatedly created and deleted, that would explain the name. I realized that at some point, I was using that in a config file to make text blink. I don't think I'm using it anymore, and the program the config file is for can blink text on it's own, but I guess the script that creates then removes it is still started at boot. It's a really bad way of making text blink.
Thanks for the second perspective. Now I need to find that script...

Edit: The config actually created and deleted the file. It didn't even blink the text for some reason.

Last edited by mee_me (2020-05-18 01:41:01)

Offline

Board footer

Powered by FluxBB