This is not your problem (others have identified it), but related:
0 byte files are still not 0 bytes in actual space. The FS has to use space to track the name, metadata, location on disk, etc. Some FSs have to allocate at least one block cluster for every file, even if the file is empty. An allocation unit size may be pretty much anything, but it's usually some multiple of 512 bytes. The "default" for NTFS and ext4 is 4096b, for instance.
In other words, you can completely fill up a volume with 0 byte files.
Fun aside: In DOS 6.0, there was a bug where the 'rmdir' command would remove empty directories even if they contained "hidden" files - effectively leaking them. It was fun to taunt your friends by running scripts that would generate 0-byte files into a temporary directory, hide them, and then 'rmdir' that temp directory. The owner of the computer would be perplexed, as the system would report that there was only the expected amount of space used by files in total, but also that 100% of the total disk space was in use. (A simple check disk fixed the problem, so this was innocuous.)
Since Red Hat made XFS default, I have been using it as my default as well. I have already taken advantage of the built in backup utility (very nice!) and live check/defrag. As a bonus, we encountered an ext4 performance issue in production and moving to XFS completely fixed it (lots of concurrent access to the same dentry).
So, for me, personal and professional default fs is XFS these days.
It should work virtualized. A complete answer is tough because starting X has not only multiple paths, but can be different based on DE, WM, distro & greeter (gdm, lightdm, etc.). The things I do to add tiling sessions on Fedora, for example, can be different than on Debian.
Here are some nuggets that might help you more, though:
.xinitrc is generally only parsed by startx.
startx is a command-line startup. You probably don't want to be using it.
/usr/share/xsessions contains XDG desktop files for starting X sessions. However, not all WM packages create a session for you to use. You can create a generic one (like I mentioned above) or you can create specific ones.
When commands are executed by lightdm, it sets $DESKTOP_SESSION to the desktop session name from the xsession desktop file.
You can use a tool like lxsession to start an X session, manage multiple configs, read XDG autostart applications, change your WM ad-hoc, etc.
You may want to file bugs against the packages your using if you think they should provide xsession files. Many WMs, I think spectrwm included, have their own concepts of auto-launching and managing certain coprocesses (especially bars like dmenu). In these cases, the WMs form as pseudo-DEs and probably do deserve their own xsession desktop file.
I created a /usr/share/xsessions/xinit.desktop file, which sets the executable to something else I created, /usr/bin/xinit-session, which looks like this:
#!/bin/bash
~/.xinitrc
I'm actually exec'ing a session app, but you could also exec your WM from the .xinitrc at that point.
The definition of a worm is that it is standalone, whereas a virus is defined by inserting itself into programs. Both kinds of programs execute locally and could use local exploits.
A virus would be possible on Linux. If a user executes a binary that uses a local root exploit, it would then have permission to write to system files. IIRC, it's libc that handles linking, so anything that targets that library could then be used to infect any executable with the same sort of exploit.
Of course, your package manager might be able to tell you that your files are not correct.
I think the real reason Linux doesn't have viruses is because they are not useful to malicious actors. Worms and trojans are less likely to fail and can do more (bad) things, and are not subject to the limitation of activation only when an infected binary is loaded.
If it has to be Debian based, anything that's based on Debian stable. Or just stick with Debian.
Some people like to quote their own "sid is stable enough for me" experiences, but the real issue isn't that sid is usually stable - the issue is that it will have random periods of instability. Tolerable for home use (maybe), but definitely not in production, where you want 100%.
If you need something newer, I would look at a Debian stable base (or heck, CentOS/RHEL), and then containerization (LXC, Docker, and so forth) to isolate the newer software and newer dependencies. Not for security, but because you don't want that newer "tree" to interfere with your base system's tree.
It's not trustworthy. It only works if the process chain has preserved the environment when using su or sudo. sudo may be configured not to permit preservation of environment. It's also unprotected - anyone could export USER=iammakingthisup.
Sorry, wasn't trying to put words in your mouth. Since the context of the thread is XFS vs ext4, by mentioning this issue with XFS, I thought you were implying that you would not have expected this issue with ext4.
Many of the perceived negatives of XFS have been fixed, but people don't delete their old blog posts.
Reliability on power loss: write barriers are now enabled by default. This means XFS flushes the journal to disk before continuing. XFS should be on par with robustness of any journaling file system.
Performance: Since delaylog became default, XFS is on par or better than ext4 for performance.
Shrinking/growing: You can grow. You cannot shrink.
Backups: XFS comes with an incremental backup utility that records everything about the FS, including extended attributes.
Also, IIRC, XFS can do fsck while the filesystem is active, so you don't have to delay bootup for it.
One potential downside, XFS assumes your hardware operates correctly and doesn't bake in paranoia around it being flaky. I.e. if your drive doesn't flush when it's asked so that it can perform better on benchmarks, you're gonna have a bad time.
I have read that this problem comes in part from development goals. ext4 is developed largely on & for unreliable consumer equipment, where XFS has always focused on high-grade professional equipment. What I'm getting at is that XFS tends to "trust" the drive to perform as expected. I say "write this here" and the drive does it. Consumer grade drives often lie about this. IIRC ext4 has a lot of unnecessary flush/wait throughout to help get around this problem, whereas XFS team generally approaches this as a "know-your-hardware" issue with tuning options.
Edit: "Write barrier support is enabled by default in XFS since kernel version 2.6.17." If your issues occurred around that era, it's possible it's a solved problem now.
A much better option for you is to NFS mount your /home. ajs124 is right, the PXE boot firmware tends to exist at a level before establishing a wireless connection is possible.
Since you're talking about app installation selection, there are other options you can layer in like Docker, that create a configuration and environment for apps.
If you really want to pursue PXE booting, have a look at home powerline networking, but read the reviews on smallnetbuilder or some such site, and learn about its caveats (for example, noise & interference, electrical circuits, real bandwidth, etc.).
Another hardware option is a wireless-to-wired hardware adapter, but I feel like that might be flaky.
This is not your problem (others have identified it), but related:
0 byte files are still not 0 bytes in actual space. The FS has to use space to track the name, metadata, location on disk, etc. Some FSs have to allocate at least one block cluster for every file, even if the file is empty. An allocation unit size may be pretty much anything, but it's usually some multiple of 512 bytes. The "default" for NTFS and ext4 is 4096b, for instance.
In other words, you can completely fill up a volume with 0 byte files.
Fun aside: In DOS 6.0, there was a bug where the 'rmdir' command would remove empty directories even if they contained "hidden" files - effectively leaking them. It was fun to taunt your friends by running scripts that would generate 0-byte files into a temporary directory, hide them, and then 'rmdir' that temp directory. The owner of the computer would be perplexed, as the system would report that there was only the expected amount of space used by files in total, but also that 100% of the total disk space was in use. (A simple check disk fixed the problem, so this was innocuous.)
Since Red Hat made XFS default, I have been using it as my default as well. I have already taken advantage of the built in backup utility (very nice!) and live check/defrag. As a bonus, we encountered an ext4 performance issue in production and moving to XFS completely fixed it (lots of concurrent access to the same
dentry).So, for me, personal and professional default fs is XFS these days.
If you have lots or large, XFS is a better bet. XFS should scale to server workloads better than ext4.
It should work virtualized. A complete answer is tough because starting X has not only multiple paths, but can be different based on DE, WM, distro & greeter (gdm, lightdm, etc.). The things I do to add tiling sessions on Fedora, for example, can be different than on Debian.
Here are some nuggets that might help you more, though:
You may want to file bugs against the packages your using if you think they should provide xsession files. Many WMs, I think spectrwm included, have their own concepts of auto-launching and managing certain coprocesses (especially bars like dmenu). In these cases, the WMs form as pseudo-DEs and probably do deserve their own xsession desktop file.
Good luck!
I created a
/usr/share/xsessions/xinit.desktopfile, which sets the executable to something else I created,/usr/bin/xinit-session, which looks like this:I'm actually
exec'ing a session app, but you could also exec your WM from the.xinitrcat that point.The definition of a worm is that it is standalone, whereas a virus is defined by inserting itself into programs. Both kinds of programs execute locally and could use local exploits.
A virus would be possible on Linux. If a user executes a binary that uses a local root exploit, it would then have permission to write to system files. IIRC, it's libc that handles linking, so anything that targets that library could then be used to infect any executable with the same sort of exploit.
Of course, your package manager might be able to tell you that your files are not correct.
I think the real reason Linux doesn't have viruses is because they are not useful to malicious actors. Worms and trojans are less likely to fail and can do more (bad) things, and are not subject to the limitation of activation only when an infected binary is loaded.
If it has to be Debian based, anything that's based on Debian stable. Or just stick with Debian.
Some people like to quote their own "sid is stable enough for me" experiences, but the real issue isn't that sid is usually stable - the issue is that it will have random periods of instability. Tolerable for home use (maybe), but definitely not in production, where you want 100%.
If you need something newer, I would look at a Debian stable base (or heck, CentOS/RHEL), and then containerization (LXC, Docker, and so forth) to isolate the newer software and newer dependencies. Not for security, but because you don't want that newer "tree" to interfere with your base system's tree.
So something like
echo $(</proc/fb)gives you nothing?Thanks. Looks like
audit=1must be in the kernel params for /proc/pid/loginuid to be set.This is just for information, not for authentication, in my particular use case.
If I had control of the binaries, definitely wouldn't need to use this.
Yeah, that was dumb.
It's not trustworthy. It only works if the process chain has preserved the environment when using
suorsudo.sudomay be configured not to permit preservation of environment. It's also unprotected - anyone couldexport USER=iammakingthisup.What shell/version you using?
I actually discovered a better form (for bash only):
$(<file)I one-lined it:
It's definitely more competitive with the
who am ivariant, if not even better.I do not have Infinality, running Ubuntu 12.04 + xmonad, and mine looks like the Win8 screen shot.
xmonad + Ubuntu 12.04 here, no problems.
Many distros already do this.
Sorry about that! Mischief managed.
Sorry, wasn't trying to put words in your mouth. Since the context of the thread is XFS vs ext4, by mentioning this issue with XFS, I thought you were implying that you would not have expected this issue with ext4.
Sure. But I don't think ext4 would have been immune in that situation, either.
Many of the perceived negatives of XFS have been fixed, but people don't delete their old blog posts.
Reliability on power loss: write barriers are now enabled by default. This means XFS flushes the journal to disk before continuing. XFS should be on par with robustness of any journaling file system.
Performance: Since delaylog became default, XFS is on par or better than ext4 for performance.
Shrinking/growing: You can grow. You cannot shrink.
Backups: XFS comes with an incremental backup utility that records everything about the FS, including extended attributes.
Also, IIRC, XFS can do fsck while the filesystem is active, so you don't have to delay bootup for it.
One potential downside, XFS assumes your hardware operates correctly and doesn't bake in paranoia around it being flaky. I.e. if your drive doesn't flush when it's asked so that it can perform better on benchmarks, you're gonna have a bad time.
I have read that this problem comes in part from development goals. ext4 is developed largely on & for unreliable consumer equipment, where XFS has always focused on high-grade professional equipment. What I'm getting at is that XFS tends to "trust" the drive to perform as expected. I say "write this here" and the drive does it. Consumer grade drives often lie about this. IIRC ext4 has a lot of unnecessary flush/wait throughout to help get around this problem, whereas XFS team generally approaches this as a "know-your-hardware" issue with tuning options.
See a bunch of FAQ question and answers for more info.
Edit: "Write barrier support is enabled by default in XFS since kernel version 2.6.17." If your issues occurred around that era, it's possible it's a solved problem now.
A much better option for you is to NFS mount your
/home. ajs124 is right, the PXE boot firmware tends to exist at a level before establishing a wireless connection is possible.Since you're talking about app installation selection, there are other options you can layer in like Docker, that create a configuration and environment for apps.
If you really want to pursue PXE booting, have a look at home powerline networking, but read the reviews on smallnetbuilder or some such site, and learn about its caveats (for example, noise & interference, electrical circuits, real bandwidth, etc.).
Another hardware option is a wireless-to-wired hardware adapter, but I feel like that might be flaky.