0

I am just working on a QT GUI program which is the only program executed on a minimal system build by buildroot for a RaspberryPi Compute Module. But I think this should not matter.

My problem is that in my code I am executing shell scripts with QProcess, but when I run my program out of inittab I can't get any exit codes of the shell scripts. I know that they have been executed because I tried some mv and mkdir, and the folders existed afterwards. But they script does not return me the exit code.

" When I run my program out of init.d everything works perfectly. Only problem I have with this solution, is that I don't have root permissions, which I need for example for reboot command. " Edit

This above was wrong. I mentioned that i switched to inittab at the same time when i updated buildroot. So init.d does not work now either. So must be a problem with buildroot. Does anyone know how this can happen?

*Edit Here is what my inittab looks like:

# Startup the system
::sysinit:/bin/mount -t proc proc /proc
::sysinit:/bin/mount -o remount,rw /
::sysinit:/bin/mkdir -p /dev/pts
::sysinit:/bin/mkdir -p /dev/shm
::sysinit:/bin/mount -a
::sysinit:/bin/hostname -F /etc/hostname
# now run any rc scripts
::sysinit:/etc/init.d/rcS

# console tty1 autologin as root
#::respawn:/bin/login root tty1 </dev/tty1 >/dev/tty1 2>&1

#starting ziesel
:12345:respawn:/usr/bin/ziesel

# Put a getty on the serial port
#tty1::respawn:/sbin/getty -L  tty1 0 vt100 # GENERIC_SERIAL

# Stuff to do for the 3-finger salute
#::ctrlaltdel:/sbin/reboot

# Stuff to do before rebooting
::shutdown:/etc/init.d/rcK
::shutdown:/sbin/swapoff -a
::shutdown:/bin/umount -a -r

So as you can see I only start my ziesel program here, without any console. But when I don't comment out the line above, where I auto login as root, it does not work either.

I would be very very grateful for any suggestions.

0

At this point, I am not sure why QProcess behaves differently when the Qt program is started directly from inittab or from a init.d script.

However, what is sure is that starting your program from an init.d script will definitely start the program as root, contrary to what your question says.

  • I also thought init.d should start as root. But when i try to process->start("reboot", QStringList << "now"); it returns permisssion denied. – LogiSch17 Feb 14 '17 at 11:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.