PATH to ZFS utilities broken in TrueNAS SCALE?

Joined
Sep 25, 2021
Messages
4
I recently reinstalled TrueNAS SCALE on my NAS after having some issues (currently on 22.12.3.1). Has the ability to run ZFS commands been removed from the shell? I specifically chose TrueNAS to be able to experiment with and learn ZFS with the backup of a graphical environment (through the web portal). When were these removed and is there a way to get them back? I also see that apt has also been removed.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
What commands?

All of the ZFS crap is over in /usr/sbin (/usr/sbin/zfs, /usr/sbin/zpool, etc). This has previously been discussed several times.




The fix is that if you choose to use an alternative administrative account, you have to be UNIX-fu enough to know to put in a reasonable set of dotfiles so that your alternative administrative account can populate PATH with common root paths so that you can run common root commands without having to specify the entire path. Or if you're masochistic, another fix is to just type "/usr/sbin/zfs" or "/usr/sbin/zpool" every time.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
Oh. This is resultant of the admin vs root account change from a while back. I thought OP mentioned in a recent update.

As far as I know, it hasn't been fixed, and there will still be failure modes where users pull over inappropriately PATH'ed dotfiles as well. This problem is unlikely to ever go totally away.
 
Joined
Sep 25, 2021
Messages
4
Thanks for the responses! I hadn't thought to check $PATH because.. I've never had to before.. But I see it now. Thanks!
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
Thanks for the responses! I hadn't thought to check $PATH because.. I've never had to before.. But I see it now. Thanks!

Yeah, that sort of tears at me because many users would expect this to be set up "sanely" but by using the default /etc/profile script it isn't. Having worked with UNIX for many years it doesn't bother *me* much to have to spell out the full path in cases like this, but it also strikes me as a design failure because with users like root the PATH is adjusted accordingly, but I'm not sure how that should work where you have a varying alternate administrator name.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
I also see that apt has also been removed.
apt was only ever available (i.e., executable by default) in pre-release versions of SCALE. Just as in CORE, you should never be using the OS-level package manager in the base OS.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
apt was only ever available (i.e., executable by default) in pre-release versions of SCALE. Just as in CORE, you should never be using the OS-level package manager in the base OS.

This is the problem with using a common Linux release as the basis for the appliance. You get all kinds of people running in thinking "oh I know all about this" and trying to make it work the way they think it should.
 

neofusion

Contributor
Joined
Apr 2, 2022
Messages
159
All of the ZFS crap is over in /usr/sbin (/usr/sbin/zfs, /usr/sbin/zpool, etc). This has previously been discussed several times.




The fix is that if you choose to use an alternative administrative account, you have to be UNIX-fu enough to know to put in a reasonable set of dotfiles so that your alternative administrative account can populate PATH with common root paths so that you can run common root commands without having to specify the entire path. Or if you're masochistic, another fix is to just type "/usr/sbin/zfs" or "/usr/sbin/zpool" every time.
Have you seen anything from iXsystems signalling that they acknowledged the problem and that they are working it?
Placing the onus on the end user to ensure a basic sane PATH is setup goes counter to what one would expect from a product toted as an appliance.

Setting up an alternative admin account is not a weird customisation; according to the documentation, it's a highly recommended path the user expected to take. There is no mention of needing to set up a PATH anywhere in the docs. Having said that, I find the whole "first admin user account"-process is too vital to be as singularly manual as it currently is. Some form of railroading, a wizard if you will, would do much good there. A wizard for making a pool and a share would also be useful, while obviously more difficult to successfully accomplish due to quickly diverging user needs.

There's also the fact that when you disable the root password (as is recommended in the docs) you lose the ability to use the Linux Shell from the TrueNAS Console, since the Console expects the root account to login and gives no other option.

My conclusion has so far been that these issues are due to them not being finished with the transition from root to user created admin account, but that they are working on it. Are my expectations unreasonable?
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
Have you seen anything from iXsystems signalling that they acknowledged the problem and that they are working it?

No. From a UNIX perspective, this isn't really a problem and there's not really anything to work on.

Placing the onus on the end user to ensure a basic sane PATH is setup goes counter to what one would expect from a product toted as an appliance.

That's kind of off-base. UNIX has traditionally expected users to manage their own choice of shell, dotfiles, etc. Linux and more "modern" shells have obliquely acknowledged the problem through mechanisms such as /etc/profile, which work to mitigate deficiencies in an empty homedir+environment, but iX has been somewhat reluctant to make changes to the as-shipped base system that comes from upstream. Such changes typically have unexpected side effects.

The flip side to your comment would be to force a particular environment that is known to work, on the theory that perhaps a user imports dotfiles that are not TrueNAS compatible, perhaps used as NFS homedirs for a UNIX cluster. In such a case, the namespace overlap breaks something somewhere and resolving it involves ugliness of some sort.

In reality the real problem here is the implementation of the alternative admin login. They should just get rid of it. "toor" should have taught us all not to do this a long time ago, but each generation seems to have to learn lessons the hard way.

My conclusion has so far been that these issues are due to them not being finished with the transition from root to user created admin account, but that they are working on it. Are my expectations unreasonable?

Possibly. The user-created admin account concept fits poorly into the system framework and perhaps it isn't the place of an obscure appliance OS to be trying to redesign UNIX security fundamentals that have developed over the last forty years. It isn't "unreasonable" to want it to work, but every time I see a halfarse attempt to re-imagine something like this (look at VyOS for example) it seems to have lots wrong with it in the end.

UNIX based appliances are of significant interest to me, as I designed the first open source FreeBSD appliance platform that eventually morphed into PicoBSD, almost thirty years ago. I might have some significant opinions as a result. :smile: If you want a quick opinion that the original implementation of UNIX "root" was deficient, consider it given. It hasn't gotten better with time, either. For every improvement such as (for ex.) MAC/ntpd, a baby step forward, you have security idiocy such as systemd (huge step backward).
 

cb88

Dabbler
Joined
May 11, 2022
Messages
24
No. From a UNIX perspective, this isn't really a problem and there's not really anything to work on.
That's a cop out honestly.

That would only apply if it were being used as a development machine aka a vanilla install... its an appliance it should be setup with sane defaults. Installing tools in an appliance but not putting them in the path of the administrative account (no longer root) is an egregious oversight and a pain in the ass for no reason.

All of this is ironic coming from me, someone that used to use Arch back when they still pretended to be a BSD with a Linux kernel a decade ago long before systemd nuked the Linux landscape. Heh I am being a bit facetious but why not just throw away the whole web gui and all the hand holding if truenas isn't trying to an easy to use appliance???
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
That's a cop out honestly.

That would only apply if it were being used as a development machine aka a vanilla install... its an appliance it should be setup with sane defaults. Installing tools in an appliance but not putting them in the path of the administrative account (no longer root) is an egregious oversight and a pain in the ass for no reason.

Weirdest thing I've heard all day. You are implying that they chose to put them in some alternative location. They did not. They put them right where the underlying Debian OS laid them down. It would be similarly weird but probably just as accurate to argue that Debian is broken because it failed to include the needed PATH element in a non-root administrative account's PATH. You can see that for yourself in /etc/profile.

All of this is ironic coming from me, someone that used to use Arch back when they still pretended to be a BSD with a Linux kernel a decade ago long before systemd nuked the Linux landscape. Heh I am being a bit facetious but why not just throw away the whole web gui and all the hand holding if truenas isn't trying to an easy to use appliance???

Because you're not expected to use the shell. That's not the intended purpose of having non-root administrative accounts. So it's not a cop out, it's a misunderstanding on your part of what sort of functionality the developers are expecting you to use. You are, in fact, supposed to use the whole web gui and all the hand holding because TrueNAS is trying to be an easy to use appliance. The fact that you USED to be able to easily use the shell was not in fact a guarantee of future availability.
 

cb88

Dabbler
Joined
May 11, 2022
Messages
24
Weirdest thing I've heard all day. You are implying that they chose to put them in some alternative location. They did not. They put them right where the underlying Debian OS laid them down. It would be similarly weird but probably just as accurate to argue that Debian is broken because it failed to include the needed PATH element in a non-root administrative account's PATH. You can see that for yourself in /etc/profile.



Because you're not expected to use the shell. That's not the intended purpose of having non-root administrative accounts. So it's not a cop out, it's a misunderstanding on your part of what sort of functionality the developers are expecting you to use. You are, in fact, supposed to use the whole web gui and all the hand holding because TrueNAS is trying to be an easy to use appliance. The fact that you USED to be able to easily use the shell was not in fact a guarantee of future availability.
*ignores the inability to tell what is keeping a dataset busy* from the WEB.... I'm not "expected"to the use the shell is a laugh when its imperative to day to day use of the system because the GUI isn't good enough.

Sure it takes me about 30 sec to get to a shell and find out what it is... but it cannot be done from the GUI (It could be but nobody has implemented that because nobody is actually serious about the idea that you don't need to get to the shell).

TrueNAS isn't usable without shell access.... period.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
TrueNAS isn't usable without shell access.... period.

Lots of people use TrueNAS without shell access, so that's really only an opinion, not "period".

Yes. But what's the point?

The point is he's using something that the developers do not expect him to use, insisting that he MUST use it that way, and then blaming the developers when it doesn't work the way he wants because he failed to take the common UNIX steps that he certainly could take to make it work right. I vote PEBCAK, but what do I know. I am pretty sure I'm not misreading the situation here at this point. Have the user put in a suitable dotfile to instantiate a PATH and suddenly it works. Whee.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
I meant what's the point in the statement that TN is not useable without shell? I'd pretty much agree, but that is not a problem in my opinion. Want to run a Unix based server? Learn some basic Unix skills.
 

Davvo

MVP
Joined
Jul 12, 2022
Messages
3,222

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
They should just remove that feature. Use ssh, folks.
 
Top