Homework 4#
systemd
On run01 VM, install package
tinyproxy.Check the status of service
tinyproxy.Assign ownership of
tinyproxyuser and group on directory /var/log/tinyproxy.Restart service
tinyproxy.Check the service status.
Browse the content of the unit file.
User environment
On run01, create directory
/usr/local/software/bin.Add the directory in the PATH environment variable for user jerry.
Add the directory in the PATH environment variable for all the users on the system.
Python scripting
On the desktop, copy file
/etc/libvirt/qemu/kvm1.xmlinto directory Python, where jupyter notebook is running. Make the file readable for all users.Develop a python script in jupyter to read the file and print out the value of RAM, number of CPUs, and the location of the qcow2 file for the VM.
Hint: in the lines, look for strings containing ‘memory’, ‘vcpu’, and ‘source file’, accordingly. Use module
reand methodsplit, re.split(), to separate the line content by regular expressions depicting symbols<,>,/>, and=.In the home directory on VD, create directory HW4. Copy
kvm1.xmlinto directory HW4. In directory HW4, implement the above python script in executable filevm_xml.py.Modify the script to read the xml file as input parameter by using
sys.argv[1]in the script to reference the file then run:./vm_xml.py kvm1.xmlCopy file
/etc/libvirt/qemu/rocky10.xmlin HW4, and run./vm_xml.py rocky10.xml