LucidLink manual Linux systemd service

  • Updated

Install LucidLink client systemd service to survive system reboot, re-activate and automatically mount Filespace in the preferred system location.

Alternatively, we have a purpose-built script for managing Filespace systemd services available in this KB article which will assist the more general implementations. 

In this article we will break down certain elements and provide guidance on how to achieve advanced configurational changes to your client once connected and linked to your Filespace.

Requires a user appropriately privileged to perform systemd systemctl operations. Root or a member of sudo group or the sudoers file modified accordingly for your user or group.

Install LucidLink client. It is recommended your distribution is updated. 

Debian based (.deb):

wget https://www.lucidlink.com/download/latest/lin64/stable/ -O lucidinstaller.deb
sudo apt install ./lucidinstaller.deb -y

Red Hat based (.rpm):

wget https://www.lucidlink.com/download/latest/lin64-rpm/stable/ -O lucidinstaller.rpm
sudo yum install lucidinstaller.rpm
Create lucidlink.service within /etc/systemd/system
 
sudo nano /etc/systemd/system/lucidlink.service
[Unit]
Description=LucidLink Filespace Daemon
After=network-online.target
[Service]
Type=simple
#User=<user>
#Group=<group>
#WorkingDirectory=/home/<user>
ExecStart=/usr/bin/lucid daemon --fs <filespace.domain> --user <fsuser> --password <fsusrpwd> --mount-point <mount>
ExecStop=/usr/bin/lucid exit
Restart=on-abort
[Install]
WantedBy=multi-user.target
Passwords with special characters will require single ' ' or double " " quoting or sufficient escaping dependent on the special characters or consult our KB which leverages systemd-escape.

Modify accordingly the command-line arguments lucid daemon --fs filespace.domain --user user1 --password password1 --mount-point /media/filespace

You can create multiple systemd unit files for various lucid daemon option --instance. Running separate instances for mounting multiple Filespaces, or mounting snapshots.

Each systemd unit file will require its own --instance <ID>. Include or exclude --root-path /media/cache.

Uncomment and modify systemd unit User, Group, WorkDirectory should you choose to run the service as a different Linux user, defaults to root and add lucid daemon option --fuse-allow-other see below.

Reload systemd daemon.

systemctl daemon-reload

Enable the LucidLink systemd service.

systemctl enable lucidlink.service

Start LucidLink daemon systemd service.

systemctl start lucidlink.service

Check LucidLink systemd service.

systemctl status lucidlink.service 

If you have systemd error or the Filespace did not mount, or if you make changes to the systemd service you will need to reload the systemd daemon systemctl daemon-reload.

If no error in systemd service check Filespace mount-point exists.

ls /media/<mount>

Review the systemd service history.

journalctl -u lucidlink.service

 

Optionally if you would like to run your systemd service as a different user other than root, you can uncomment and specify the appropriate systemd unit User, Group and WorkingDirectory.

You can then provide the daemon --fuse-allow-other to enable other users on the same Linux machine to access the mount-point. 

Note: Filesystem in Userspace (FUSE) allow_other is separate to user permissions. The user running the daemon controls their permissions, other users on the Linux system must have appropriate permissions.

Edit fuse.conf and uncomment (remove #) if you'd like the mount-point to be accessible to other users.

sudo nano /etc/fuse.conf
user_allow_other
Alternatively, run sed -i 's/#user_allow_other/user_allow_other/g' /etc/fuse.conf
[Unit]
Description=LucidLink Filespace Daemon
After=network-online.target
[Service]
Type=simple
User=<user>
Group=<group>
WorkingDirectory=/home/<user>
ExecStart=/usr/bin/lucid daemon --fs <filespace.domain> --user <fsuser> --password <fsusrpwd> --mount-point <mount> --fuse-allow-other
ExecStop=/usr/bin/lucid exit
Restart=on-abort
[Install]
WantedBy=multi-user.target

Reload systemd daemon

systemctl daemon-reload

Enable the LucidLink systemd service

systemctl enable lucidlink.service

Start LucidLink daemon systemd service

systemctl start lucidlink.service

Check LucidLink systemd service

systemctl status lucidlink.service 

If you have systemd error or the Filespace did not mount, or if you make changes to the systemd service you will need to reload the systemd daemon systemctl daemon-reload.

If no error in systemd service check Filespace mount-point exists.

ls -la /media/<mount>
If seeing timeouts to due to slow network coming online in a virtual environment, try adding extra line after WorkingDirectory ExecStartPre=/bin/sleep 30 to inject a sleep before ExecStart.
 
Advanced post operations such as increasing the client cache and or configuring the object storage maximum upload and download rates can be achieved with ExecStartPost systemd unit option.
Multiple ExecStartPost command lines are allowed and the commands are executed one after the other, serially.
 
[Unit]
Description=LucidLink Filespace Daemon
After=network-online.target
[Service]
Type=simple
ExecStart=/usr/bin/lucid daemon --fs <filespace.domain> --user <fsuser> --password <fsusrpwd> --mount-point <mount>
ExecStop=/usr/bin/lucid exit
ExecStartPost=/bin/bash -c "until lucid status | grep -q "Linked" ; do continue ; done"
ExecStartPost=/usr/bin/lucid config --set --local --DataCache.Size 25GB
ExecStartPost=/usr/bin/lucid config --set --local --ObjectScheduler.MaxUploadRate 10MB
ExecStartPost=/usr/bin/lucid config --set --local --ObjectScheduler.MaxDownloadRate 10MB
Restart=on-abort
[Install]
WantedBy=multi-user.target
Make sure the lucid daemon is successfully connected (linked to the Filespace and or mounted) before applying any additional commands in your ExecStartPost steps. Otherwise, these steps might fail and trigger the ExecStop command. 
In our example we've included a lucid status until loop to ensure the client status is "Linked" before continuing.

As always, please reach out to our support should you require and additional information, configurational guidance, or running into difficulty.

We are all too happy to assist. 

Was this article helpful?

0 out of 0 found this helpful