[Ovirt-devel] [PATCH] block manual setup runs when dropped to shell
Joey Boggs
jboggs at redhat.com
Thu Sep 1 02:05:43 UTC 2011
On 08/31/2011 07:16 PM, Mike Burns wrote:
> NACK -- see comments inline
>
> On Tue, 2011-08-30 at 15:20 -0400, Joey Boggs wrote:
>> rhbz#733589
>>
>> Signed-off-by: Joey Boggs<jboggs at redhat.com>
>> ---
>> scripts/ovirt-config-setup.py | 7 +++++--
>> scripts/ovirtfunctions.py | 9 +++++++++
>> 2 files changed, 14 insertions(+), 2 deletions(-)
>>
>> diff --git a/scripts/ovirt-config-setup.py b/scripts/ovirt-config-setup.py
>> index 09c21ec..00df6fa 100755
>> --- a/scripts/ovirt-config-setup.py
>> +++ b/scripts/ovirt-config-setup.py
>> @@ -1661,8 +1661,11 @@ if __name__ == "__main__":
>> print "Unable to run setup in rescue mode"
>> sys.exit(1)
>> elif is_booted_from_local_disk() or "--force" in sys.argv:
>> - screen = NodeConfigScreen()
>> - screen.start()
>> + if manual_setup and "--force" not in sys.argv:
>> + print "Unable to run setup manually, Run \"exit\" to return to setup"
>> + else:
>> + screen = NodeConfigScreen()
>> + screen.start()
>> else:
>> print "Setup must be run after installation and reboot"
>> sys.exit(1)
>> diff --git a/scripts/ovirtfunctions.py b/scripts/ovirtfunctions.py
>> index 1bacb3f..09facaf 100644
>> --- a/scripts/ovirtfunctions.py
>> +++ b/scripts/ovirtfunctions.py
>> @@ -191,6 +191,15 @@ def is_rescue_mode():
>> return True
>> return False
>>
>> +def manual_setup():
>> + manual_cmd = "ps -ed|grep ovirt-admin"
> on first login, it fails.
>
> I installed using rootpw to setup root password, then
> edited /usr/libexec/ovirt-admin-shell to be this:
>
> #!/bin/bash
> . /etc/profile
> # Hide kernel messages on the console
> sudo dmesg -n 1
> echo $$
> ps -ed | grep ovirt-admin
> sudo /usr/libexec/ovirt-config-setup
> read x
>
> Then logged out and tried login as admin:
>
> localhost.localdomain login: admin
> Password:
> Last login: Wed Aug 31 22:59:45 on tty1
> 1938
> 1938 ttyS0 00:00:00 ovirt-admin-she
> Unable to run setup manually, Run "exit" to return to setup
>
> There are a couple of things that could be done:
>
> ps -ed | grep ovirt-admin | grep -v $$
>
> look for ovirt-config-setup already running (also need to filter out
> current process from results)
>
> Look at PPID of ovirt-config-setup and if that is ovirt-admin-shell,
> then continue with login
>
>> + manual = subprocess.Popen(manual_cmd, shell=True, stdout=PIPE, stderr=STDOUT)
>> + manual_output = manual.stdout.read().strip()
>> + if len(manual_output):
>> + return True
>> + else:
>> + return False
>> +
>> # was firstboot menu already shown?
>> # state is stored in persistent config partition
>> def is_firstboot():
>
What about just creating a lock file in /var/run/lock/subsys?
More information about the ovirt-devel
mailing list