On Thu, 16 Oct 2014 15:16:59 -0400
Yomi Ogunwumi <abyo...@gmail.com> wrote:

>Ah. What will happen if I hit a segfault in Enlightenment if I'm not
>using a display manager? Will everything recover as it normally does?
>
>Yomi

Yomi,

It could hang or crash back to the console. dunno.

I'm thinking you could always have it pause at the console and ask to
proceed with starting enlightenment to the locked state or not (with a
timeout to proceed) with a simple shell wrapper auto-launched
from /etc/rc.local. You're then able recover from a failed e start.

You'd need to insure the appropriate user is running enlightenment, for
which you could either hack sudo or su into the wrapper (if you wanted
to allow multiple users), or setuid the wrapper script rc.local runs,
so it always only runs as a single user.


Here's a quick script to try. Copy between the [*-snip] markers below,
and save in /usr/bin/start-e (do this as root, and then make it
executable: chmod 700 /usr/bin/start-e ).

Call the script from /etc/rc.local as the last command before 'exit 0'
in that file, as in:
...
/usr/bin/start-e
exit 0

I have not run this as my actual start script, but it
behaves as expected when run as is in a terminal.

You'll need to uncomment the actual command in the script to have it
work for real. See comments in script.

...[start-snip]... (watch for email line-wrapping...)

#!/bin/bash
# wrapper to start enlightenment from /etc/rc.local
# to avoid the necessity of a display manager.
# basically, root needs to run this @ startup

function start_e() {

    # initialize
    local ex=
    local ans=
    local valid=
    local euser=

    # adjust below vars as desired
    local bail_seconds=3
    local bailp="press any alphanumeric key to exit to console: "
    local user_timeout=60
    local userp="enter user name: "
    # add default login username if desired
    local default_user=

    [[ "$(id -u)" == "0" ]] || { echo "you must be root to run this."
        return 1
    }

    ex=$(read -r -N 1 -t ${bail_seconds} -p "${bailp}" ex; echo ${ex})
    [[ ${ex} =~ [[:alnum:]] ]] && {
        echo
        return 1
    } || {
        echo
    }

    until [[ ${valid} ]]; do
        read -r -t ${user_timeout} -p "${userp}"  ans
        [[ $(grep -w "^${ans:-${default_user}}" /etc/passwd) ]] && {
            valid=1
            euser="${ans:-${default_user}}"
        } || {
            echo "invalid user name. try again."
        }
    done

    # remove or comment out if you really want to run as root
    [[ "${euser}" == "root" ]] && {
        echo "nice try. bye bye."
        return 1
    }

    # remove 'echo' and quotes from command to enable
    [[ ${euser} ]] && {
        echo "su - ${euser} /usr/bin/enlightenment_start"
    } || {
        return 1
    }

}

# run it
start_e


.....[end-snip].....


Anyway, that's my hack for you. No guarantees this wont kill your dog,
make your wife pregnant, or get you fired... Use at own risk.

If you have improvements, or find a bug, let me know. For instance, not
sure if rc.local is best to launch it (will it be interactive
correctly?).

--
Regards,
Christopher Barry

Random geeky fortune:
Money and women are the most sought after and the least known of any two
things we have.
                -- The Best of Will Rogers

------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
enlightenment-users mailing list
enlightenment-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-users

Reply via email to