Difference between revisions of "Enable Non Root Gigaflow"

From Observer GigaFlow Support | VIAVI Solutions Inc.
Jump to: navigation, search
 
(2 intermediate revisions by one user not shown)
Line 4: Line 4:
 
Make sure there is no password so the account can be used on startup
 
Make sure there is no password so the account can be used on startup
 
  passwd -d rosuser
 
  passwd -d rosuser
Sset files to be owned by this user, will need to be done after every update
+
Set files to be owned by this user.
 +
Note that this will need to be done after every update
 
  chown -R rosuser:rosuser /opt/ros
 
  chown -R rosuser:rosuser /opt/ros
 
  chown -R rosuser:rosuser /etc/init.d/rosd  
 
  chown -R rosuser:rosuser /etc/init.d/rosd  
Line 11: Line 12:
 
Change the su command on line 15 to use the required user (rosuser in this case)
 
Change the su command on line 15 to use the required user (rosuser in this case)
 
  su rosuser -c ${_ROS_ROOT}/resources/start
 
  su rosuser -c ${_ROS_ROOT}/resources/start
Test that it works by logging in as the user and starting the service
+
Test that it works by logging in as the user and starting the service.
 +
If Gigaflow was already running as root, you will have to stop it first.
 
  su - rosuser
 
  su - rosuser
 
  /etc/init.d/ros restart
 
  /etc/init.d/ros restart
  
 
Note that by using a non root account, you will not be able to user ports <1024
 
Note that by using a non root account, you will not be able to user ports <1024
 +
 +
When updating the software you will need to perform a similar process
 +
wget -p http://95.85.35.209/software/ros_unix.tgz
 +
sudo -u rosuser /etc/init.d/rosd stop
 +
sudo -u rosuser tar -vxzf ./95.85.35.209/software/ros_unix.tgz -C /
 +
chmod 755 /opt/ros -R
 +
chown -R rosuser:rosuser /opt/ros
 +
sudo -u rosuser /etc/init.d/rosd start

Latest revision as of 13:33, 11 March 2021

Add the user account name you want

useradd rosuser

Make sure there is no password so the account can be used on startup

passwd -d rosuser

Set files to be owned by this user. Note that this will need to be done after every update

chown -R rosuser:rosuser /opt/ros
chown -R rosuser:rosuser /etc/init.d/rosd 

Edit the default service file

vi /etc/init.d/rosd 

Change the su command on line 15 to use the required user (rosuser in this case)

su rosuser -c ${_ROS_ROOT}/resources/start

Test that it works by logging in as the user and starting the service. If Gigaflow was already running as root, you will have to stop it first.

su - rosuser
/etc/init.d/ros restart

Note that by using a non root account, you will not be able to user ports <1024

When updating the software you will need to perform a similar process

wget -p http://95.85.35.209/software/ros_unix.tgz
sudo -u rosuser /etc/init.d/rosd stop
sudo -u rosuser tar -vxzf ./95.85.35.209/software/ros_unix.tgz -C /
chmod 755 /opt/ros -R
chown -R rosuser:rosuser /opt/ros
sudo -u rosuser /etc/init.d/rosd start