Even if it is better, it should stay 100% compatible with 'sudo gainroot'. Looks like you tried but still I would suggest to drop '-' after su from /usr/sbin/gainroot to make it more compatible with original version. You can add it to your new root script so it is still 'easy'. So root script would become "sudo gainroot -" and in original gainroot use something like "exec su $@". Using exec will avoid one sh process in calling stack (=save some memory). Same could be done in your new root script so together you will save two waiting shells (try it with ps, top or htop from SDK repository).