SOLVED: chmod +x rawtransfer.py?
Added by Patrick Goetz almost 7 years ago
Based on the instructions here:
http://emg.nysbc.org/projects/leginon/wiki/DDD_raw_frame_file_transfer
it appears that rawtransfer.py must also be executable?
(I recall seeing a note to `chmod +x rctacquisition.py`, but don't recall seeing anything like this for rawtransfer.py.)
Additional question: I have the camera PCs frames folder mounted on the linux box. Is there any reason why I can't use --method=mv? I'm not sure I follow the Wiki instruction on this matter.
Replies (5)
RE: chmod +x rawtransfer.py? - Added by Anchi Cheng almost 7 years ago
When rawtransfer.py checked out from git repository, the mode should already be set as 755.
RE: chmod +x rawtransfer.py? - Added by Patrick Goetz almost 7 years ago
So, this is what it looks like in the git clone:
cnsit@kraken:~/leginon/myami-beta/leginon$ ls -l raw* -rwxrwxr-x 1 cnsit cnsit 19276 Nov 29 12:52 rawtransfer.py
However,
# ./pysetup.sh install
appears to have copied it over to $PYTHONSITEPKG without the +x:
root@kraken:/usr/local/lib/python2.7/dist-packages/leginon# ls -l rawtransfer.py -rw-r--r-- 1 root root 19276 Nov 29 12:52 rawtransfer.py
RE: chmod +x rawtransfer.py? - Added by Anchi Cheng almost 7 years ago
I see.
What you may want to do is to copy rawtransfer.py to somewhere you can access from your $PATH environment variable because just being executable is not enough to find it. I do not think it makes sense for $PATH environment variable to look for files in the dist-packages directory. This is similar to start-leginon.py and appion directories.
Thanks for pointing this out. I will make changes in the setup.py as well as wiki.
RE: chmod +x rawtransfer.py? - Added by Patrick Goetz almost 7 years ago
OK, here is a systemd solution that works. It would be more elegant using Environment directives, but these don't seem to be supported by the version of systemd that ships with Ubuntu 16.04. Note that if you're still on CentOS 6, this won't work for you, but should be fine on CentOS 7. The added bonus is that rawtransfer.py is restarted automatically if it crashes or dies.
Create a file in /etc/systemd/system which ends in .service (we have 2 microscopes, so there is a service file for each microscope; e.g. rawtransfer-krios.service)
[Unit] Description=rawtransfer.py service for Krios After=network.target [Service] Type=simple Restart=on-failure User=root Group=root ExecStart=/usr/local/lib/python2.7/dist-packages/leginon/rawtransfer.py --method=rsync --source_path=/cryodata/krios-k2-frames --camera_host=krios-k2 --destination_head=/cryodata 2>&1 >/var/log/rawtransfer-krios-k2.log [Install] WantedBy=multi-user.target
Start/Stop the service by typing:
systemctl start rawtransfer-krios systemctl stop rawtransfer-krios
To set rawtransfer.py to start automatically when the system boots:
systemctl enable rawtransfer-krios
RE: SOLVED: chmod +x rawtransfer.py? - Added by Anchi Cheng almost 7 years ago
Created Issue #5445. See the python installator solution there.