Miert is *** a linux kernel?

Fórumok

Mostmar inditanom kellet egy ilyen topicot, nem birom!

Ide mindeki leirhatja mitol kezdett el sirni.

Nalam most ez okozott kemeny testi fajdalmat:

drivers/sbus/char/bbc_envctrl.c:


static void do_envctrl_shutdown(struct bbc_cpu_temperature *tp)
{ 

        static int shutting_down = 0;
        static char *envp[] = { "HOME=/", "TERM=linux", "PATH=/sbin:/usr/sbin:/bin:/usr/bin", NULL };
        char *argv[] = { "/sbin/shutdown", "-h", "now", NULL };
  
        char *type = "???";
        s8 val = -1;

        if (shutting_down != 0)
                return;

        if (tp->curr_amb_temp >= amb_temp_limits[tp->index].high_shutdown ||
            tp->curr_amb_temp < amb_temp_limits[tp->index].low_shutdown) {
                type = "ambient";
                val = tp->curr_amb_temp;
        } else if (tp->curr_cpu_temp >= cpu_temp_limits[tp->index].high_shutdown ||
                   tp->curr_cpu_temp < cpu_temp_limits[tp->index].low_shutdown) {
                type = "CPU";
                val = tp->curr_cpu_temp;
        }

        printk(KERN_CRIT "temp%d: Outside of safe %s "
               "operating temperature, %d C.\n",
               tp->index, type, val);

        printk(KERN_CRIT "kenvctrld: Shutting down the system now.\n");

        shutting_down = 1;

        if (call_usermodehelper("/sbin/shutdown", argv, envp, 0) < 0)
                printk(KERN_CRIT "envctrl: shutdown execution failed\n");

}

A lenyeget kiemeltem a konnyeb eszrevehetoseg erdekeben. Igen kerem szepen ... tavolutisuk el az /sbin/shutdown -t es had egjen a vas! Meg egyebkent is userland programot hivni ... istenem.

Hozzászólások

ha megnézed, talán azért van ez így megcsinálva, hogy a gépet _SZABÁLYOSAN_ állítsa le és ne csak lelője mindenfelé előskészület nélkül, és a leállítás lehet disztrofüggő, hogy ki mit hogy csinál...

linux v2.6.22.15 + madwifi v0.9.3.3-mal itt
debian gnu/linux @ linux-2.6.22.16-pancs1

... az egy dolog, ígaz elég gányul néz ki ...

* bbc_envctrl.c: UltraSPARC-III environment control driver.

de viszont ilyen hw-t is kevesen használnak, mivel ebben a driverben van benne...

linux v2.6.22.15 + madwifi v0.9.3.3-mal itt
debian gnu/linux @ linux-2.6.22.16-pancs1

A kernel nehogymar azert vesszen a funkcionalitasabol, mert en kitorlok rootkent egy fajlt. Erzed a problemat nem?
Szerintem nem allja meg a helyet a magyarazatod, mert a leallitas _NE_ disztrofuggo legyen. Marmint persze, a szolgaltatasok leallitasa legyen az, de ez a kodreszlet nem arrol szol.

Lol
Tipikus quickfix, amit otthagytak, mert mukodik.

és itt a magyarázat a kommentben:


*
 * If the temperature begins to rise/fall outside of the acceptable
 * operating range, a periodic warning will be sent to the kernel log.
 * The fans will be put on full blast to attempt to deal with this
 * situation.  After exceeding the acceptable operating range by a
 * certain threshold, the kernel thread will shut down the system.
 * Here, the thread is attempting to shut the machine down cleanly
 * before the hardware based power-off event is triggered.
 */

linux v2.6.22.15 + madwifi v0.9.3.3-mal itt
debian gnu/linux @ linux-2.6.22.16-pancs1

Mikor válaszolsz a levelemre végre? :)

--
Sokan nincsenek tudatában annak, / hogy egyszer mindenki meghal. / Akik ráébrednek erre, / azonnal abbahagyják az ellenségeskedést.

> Meg egyebkent is userland programot hivni ...

Írhatsz shutdown szkriptet, ami ilyenkor is lefut. De jó.

Hanyas kernel verzió ?

Az enyiben(linux-2.6.23-gentoo-r5) ezt hivja az említett függvény (true -val):


int orderly_poweroff(bool force)
{
        int argc;
        char **argv = argv_split(GFP_ATOMIC, poweroff_cmd, &argc);
        static char *envp[] = {
                "HOME=/",
                "PATH=/sbin:/bin:/usr/sbin:/usr/bin",
                NULL
        };
        int ret = -ENOMEM;
        struct subprocess_info *info;

        if (argv == NULL) {
                printk(KERN_WARNING "%s failed to allocate memory for \"%s\"\n",
                       __func__, poweroff_cmd);
                goto out;
        }

        info = call_usermodehelper_setup(argv[0], argv, envp);
        if (info == NULL) {
                argv_free(argv);
                goto out;
        }

        call_usermodehelper_setcleanup(info, argv_cleanup);

        ret = call_usermodehelper_exec(info, UMH_NO_WAIT);

  out:
        if (ret && force) {
                printk(KERN_WARNING "Failed to start orderly shutdown: "
                       "forcing the issue\n");

                /* I guess this should try to kick off some daemon to
                   sync and poweroff asap.  Or not even bother syncing
                   if we're doing an emergency shutdown? */
                emergency_sync();
                kernel_power_off();
        }

        return ret;
}