sg and newgrp basically do the same thing, but sg takes a command to
execute rather than just executing sh. This just seems cleaner.
| ... | ... |
@@ -592,9 +592,8 @@ fi |
| 592 | 592 |
# have to do a little more than that in our script. Since we add the group |
| 593 | 593 |
# ``libvirtd`` to our user in this script, when nova-compute is run it is |
| 594 | 594 |
# within the context of our original shell (so our groups won't be updated). |
| 595 |
-# We can send the command nova-compute to the ``newgrp`` command to execute |
|
| 596 |
-# in a specific context. |
|
| 597 |
-screen_it n-cpu "cd $NOVA_DIR && echo $NOVA_DIR/bin/nova-compute | newgrp libvirtd" |
|
| 595 |
+# Use 'sg' to execute nova-compute as a member of the libvirtd group. |
|
| 596 |
+screen_it n-cpu "cd $NOVA_DIR && sg libvirtd $NOVA_DIR/bin/nova-compute" |
|
| 598 | 597 |
screen_it n-net "cd $NOVA_DIR && $NOVA_DIR/bin/nova-network" |
| 599 | 598 |
screen_it n-sch "cd $NOVA_DIR && $NOVA_DIR/bin/nova-scheduler" |
| 600 | 599 |
screen_it n-vnc "cd $NOVNC_DIR && ./utils/nova-wsproxy.py 6080 --web . --flagfile=../nova/bin/nova.conf" |