history bug

Status
Not open for further replies.

Youri Andropov

Dabbler
Joined
Apr 8, 2014
Messages
34
Hi there.

Can anyone help me : I want to use ksh93 as shell, but :

Code:
freenas# history
-ksh93: hist: history file cannot open [Read-only file system]


FreeNAS is installed on a 8 GB usb thumb drive :

Code:
freenas# mount
/dev/ufs/FreeNASs1a on / (ufs, local, read-only)
devfs on /dev (devfs, local, multilabel)
/dev/md0 on /etc (ufs, local)
/dev/md1 on /mnt (ufs, local)
/dev/md2 on /var (ufs, local)
/dev/ufs/FreeNASs4 on /data (ufs, local, noatime, soft-updates)


Code:
freenas# ls /dev/da0*
/dev/da0        /dev/da0s1      /dev/da0s1a     /dev/da0s2      /dev/da0s3      /dev/da0s4
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Uh.. you shouldn't be doing anything on the FreeNAS install. So what you are doing is already unapproved and not supported.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
No, trying to change the shell to ksh93 is unsupported. Nothing should be getting installed, edited, or deleted from the command line that affects any data on the USB. "history" works just fine... observe:

[root@freenas] ~# history
1 1:21 history

That error means your installation media is bad or someone was doing things they shouldn't be doing. I'll let you figure out which one is the case.
 

Youri Andropov

Dabbler
Joined
Apr 8, 2014
Messages
34
I'm just using ksh93 in my putty console. If not supported, why is it embedded in freenas distrib ?
My diagnostic is that "history" fails because freenas cannot write the "/.sh_history" file, because of the read-only "/" mount.

Your history works, but are you using a thumb drive too ? Can you type "mount" ?
What about mounting "/" as read-write ?
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
/ is read-only, but only kind of.

The OS thinks it's writeable, and it uses RAM to pretend it's writeable. But the USB stick is actually read-only, so anything you write to / or below doesn't go to the USB stick. So on reboot it's gone again.

You can mount / as writeable, and you'll be horribly sorry with the consequences. That's one of those things that we again say aren't recommended, etc. FreeNAS is an appliance. It's meant to be used as an appliance and nothing else. If this isn't acceptable for your use-case you may want to use FreeBSD instead.

As for why it's in the freenas distribution, I don't know. I won't pretend to make up excuses for why stuff is or isn't on the installation. Some of it is abandoned stuff. But, if you look through the manual you'll find no mention of using ksh93. That pretty much means you're doing stuff that isn't recommended or supported.
 

Youri Andropov

Dabbler
Joined
Apr 8, 2014
Messages
34
Ok, so even with ksh, history should work ?
My USB thumb drive is new, freenas is recently installed, so should I reinstall ?

I'm just trying to figure out if I have hardware or software issues.
 
D

dlavigne

Guest
I'm confused on how you're trying to use ksh. Are you switching to that shell in the Shell of the web GUI? Are you logging in as a user that has ksh selected as their shell in Users?
 

Youri Andropov

Dabbler
Joined
Apr 8, 2014
Messages
34
I connect with putty using SSH protocol.
I have modified the root user within the GUI to use ksh93 as default shell.
The GUI allows it, so I suppose this is supported, right ?

But I note that CTRL+P, arrow up and various keyboard shortcut don't work, as well as the history command.
When I switch to the 'bash' shell, history works...
 
D

dlavigne

Guest
While in the SSH session, what path does the SHELL variable point to if you type env ?
 
D

dlavigne

Guest
Please create a bug report at bugs.freenas.org and post the issue number here.
 
Status
Not open for further replies.
Top