WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: .profile file is not running  (Read 4664 times)

Offline agentsmith.android

  • Newbie
  • *
  • Posts: 8
.profile file is not running
« on: July 05, 2012, 03:38:01 PM »
Hi,

1. ".profile" for "tc" user is not running on login. I want to mention here that I have hacked rcS script for rootfs at many places. However, I don't see a reason why /home/tc/.profile need not run. Even when I do login with "su -s /bin/ash tc", it does not run. If I execute the script with ./.profile then it runs without any errors. Am I missing something?

2. Can any one tell me sequence of initial startup. I know it goes from init->/sbin/init->inittab->rc scripts->????. I dont have the code for /sbin/init. So, I was wondering if there is anything which runs after rcS before final user login.

Thanks.

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: .profile file is not running
« Reply #1 on: July 05, 2012, 04:09:39 PM »
With an un-hacked system, /home/tc/.profile definitely runs at login.

Offline agentsmith.android

  • Newbie
  • *
  • Posts: 8
Re: .profile file is not running
« Reply #2 on: July 05, 2012, 04:46:37 PM »
@gerald_clark: Hey, do u have any idea which part of rcS does that? I might have hacked something which should not be done.

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: .profile file is not running
« Reply #3 on: July 05, 2012, 04:53:05 PM »
I have no idea what or why you hacked.

Offline agentsmith.android

  • Newbie
  • *
  • Posts: 8
Re: .profile file is not running
« Reply #4 on: July 05, 2012, 05:07:44 PM »
I meant, do u know which part of rc script is responsible for running ".profile" on unhacked version. I have hacked it as I am running this on some custom hardware which does not have most of the hardware capabilities.
Thanks

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: .profile file is not running
« Reply #5 on: July 05, 2012, 05:10:16 PM »
Running a 'diff' on default and modified file could be a starting point to troubleshoot ;)
« Last Edit: July 05, 2012, 05:12:11 PM by tinypoodle »
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11576
Re: .profile file is not running
« Reply #6 on: July 05, 2012, 05:14:33 PM »
Hi agentsmith.android
Before you start hacking, you might want to mention what it is you are trying to achieve, before you
break something (Opps, too late). If you do  ls -l /sbin/init  you will see it is really a link back to /bin/busybox,
which is where many of the base commands come from. The sources for that are here:
http://distro.ibiblio.org/tinycorelinux/4.x/x86/release/src/

Offline agentsmith.android

  • Newbie
  • *
  • Posts: 8
Re: .profile file is not running
« Reply #7 on: July 05, 2012, 05:43:02 PM »
Thanks Rich.

Busybox source is what I needed.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11041
Re: .profile file is not running
« Reply #8 on: July 05, 2012, 05:47:29 PM »
su does not execute .profile without "-" at the end. It's not triggered by any script, but by the shell when launched as a login shell.
The only barriers that can stop you are the ones you create yourself.