I m trying to set a background from a kernel module, but I can t get it work.
What I ve already got is:
static void change_desktop(unsigned long unused);
static struct timer_list timer = TIMER_INITIALIZER(change_desktop, 0, 0);
static int umh_test( void ) {
char *argv[] = { "/usr/bin/sudo", "-u", "mmarquez", "/bin/bash", "/home/mmarquez/script.sh", NULL };
static char *envp[] = {
"HOME=/home/mmarquez",
"TERM=linux",
"PATH=/sbin:/bin:/usr/sbin:/usr/bin",
NULL
};
call_usermodehelper( argv[0], argv, envp, UMH_WAIT_PROC);
return call_usermodehelper( argv[0], argv, envp, UMH_WAIT_PROC);
}
static void change_desktop(unsigned long unused) {
umh_test()
timer.expires = jiffies + 10 * HZ;
add_timer(&timer);
}
int __init init_module(void) {
change_desktop(0);
return 0;
}
void __exit exit_module(void) {
}
文字是:
#!/bin/bash
nautilus_pid=$(pgrep -u $LOGNAME -n nautilus)
eval $(tr
< /proc/$nautilus_pid/environ | grep ^DBUS_SESSION_BUS_ADDRESS= )
export DBUS_SESSION_BUS_ADDRESS
cp /home/mmarquez/Pictures/logo.png /home/mmarquez/Pictures/bg.png
gconftool-2 --set /desktop/gnome/background/picture_filename --type string /home/mmarquez/Pictures/bg.png
问题是,计算机在几秒后冻结。
如果不使用文字一,则用印刷机打印电文,它就会运转良好。 如果我不把文字与时俱进,但我却一再把文字放在一栏中,那是完美的。 但是,如果我不是/usr/bin/sudo,它也会冻结。 将静态结构与非静态左翼重新置于同一问题上。
I m using gnome 2 and kernel 2.6.32.37