This line ran in a script
su --session-command="$javaCommandLine & >>$serviceLogFile 2>&1 & echo \$! >$pidFile" $serviceUser || return 1
pid="$(<$pidFile)"
echo $pid
The Pid is increased by one from the Pid the program ran by su really is.
How I do I get that program's pid?