Using Sharity-Light

Some resources related to Sharity-Light
Install Sharity-Light
Installing Sharity-Light in OpenBSD
sudo -i pkg_add -ivv sharity-light

Don't see your OS here? Consider checking additional resources:

If the resource is password protected, place the password in a text file. (This approach assumes trust of any system administrator who could access this file. This is generally considered to be more secure than specifying the password on a command line.)

Making the file
cat >> ~/share1.pwd

(To quit cat, press the EOF character (Ctrl-D) and press Enter. This method involves using redirection to a text file. If a different “text file” editor is preferred, that may also be used.)

Make sure the destination directory exists:

sudo mkdir -p /srv/sample

The name of the server must be in the /etc/hosts file. (Or maybe lmhosts, alternatively? Some further research/testing/investigatino may be warranted.)

Then, here is a basic sample command line:

cat ~/share1.pwd | sudo /usr/local/sbin/shlight //198.51.100.65/webmount /mnt/sambadrv/webmount -U shareusr -C -S -w -i

Depending on what is intended, you might want to leave off the -w parameter.

Additional command line parameters that may be useful include: -D0xff to enable debugging, or “ -W WORKGROUP ” to specify a different workgroup.

Unmounting

First, run mount which will show a “device” that was mounted. That “device” includes the PID. Then use umount. Then, after that works and the mount no longer shows up when running mount, send a SIGTERM (via kill, not a SIGKILL from “kill -9”) to the PID of the related shlight process. Then the PID should nicely disappear.

Variations of this, like using kill -9 before a successful umount, has been known to cause undesirable behavior like umount freezing up, the mount point remaining, a “nfs server shlight-PID##: not responding” messsage, and so forth. (Not recommended.)

Automatically starting Sharity-Light

Compared to many other servers, Sharity-Light may be a bit tougher to get to usefully mount automatically when a computer is started.

Currently some info/background/discussion at:

Have the startup script run the terminal multiplexer. For example, in OpenBSD:

cpytobak /etc/rc.local
echo env TERM=screen /usr/bin/sudo /usr/bin/tmux -f /etc/mountsmb.tmx| sudo -n tee -a /etc/rc.local

Then, configure the specified “terminal multiplexer” configuration file.

echo ${VISUAL}
sudoedit /etc/mountsmb.tmx

The following example tends to keep commands short, by referring to other script(s) as needed. That way, if there is (eventually) a desire to run multiple commands, this may get slightly complicated, simply by listing those commands, instead of getting very complicated because it contains all of the complexity of the commands.

new -d -s startmnt
neww -n startmnt '/root/mountone ; /bin/sh'
neww -n another '/root/mounttwo ; /bin/sh'
neww -n LastWindow /bin/sh
detach-client
list-sessions

Then, finally, in the referenced files, place the Sharity-Light commands.