Linux
- 1 minX server for non-root user
in user1(root user) shell: cat ~/.Xauthority | sudo -u user2 -i tee .Xauthority > /dev/null su - user2 (reference: https://unix.stackexchange.com/questions/108784/running-gui-application-as-another-non-root-user)
Save terminal output to file and also display output in console
tee https://askubuntu.com/questions/420981/how-do-i-save-terminal-output-to-a-file
Systemd services
start-jupyter.service
start jupyter on boot
user name: User
group name: Group
conda environment name: Env
[Unit]
Description=Start jupyter notebook
[Service]
Type=simple
ExecStart=/home/<User>/anaconda3/envs/<Env>/bin/jupyter notebook --no-browser --port 9999 --ip=0.0.0.0 --allow-root --NotebookApp.token= --notebook-dir='/home/<User>'
User=<User>
Group=<Group>
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
mount-data0.service
mount disk on boot
disk partition uuid: UUID
Description=Mount data0
[Service]
Type=oneshot
ExecStart=/bin/mount --uuid <UUID> /data0
ExecStop=/bin/umount /data0
RemainAfterExit=True
User=root
[Install]
WantedBy=multi-user.target