Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Setting up stuff on first log-in
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Edgaer
Tux's lil' helper
Tux's lil' helper


Joined: 01 Jul 2002
Posts: 145
Location: The Isle of the Sundered

PostPosted: Sat Aug 31, 2002 6:00 pm    Post subject: Setting up stuff on first log-in Reply with quote

How do I set things up so that certain tasks are preformed on first login (and first login only)? Things like generating public ssh keys, configuring basic crontab jobs, etc. Basically I'm thinking about upgrading to the gcc3.1.1 based gentoo and maybe xfs or something but am wondering like how to help automate setting up all the junk I have to manually when creating my user account(s) and stuff
_________________
--First General Edgaer
Hope is the last to die. Unlike the icq flower.
Back to top
View user's profile Send private message
rac
Bodhisattva
Bodhisattva


Joined: 30 May 2002
Posts: 6553
Location: Japanifornia

PostPosted: Sat Aug 31, 2002 7:06 pm    Post subject: Reply with quote

You could wrap your first-time only commands inside a test for the existence of a particular dotfile in your home directory. If the file already exists, then nothing happens. After your initial startup has begun, touch the file to create it to disable the initial startup commands. You could invert this test to check for the absence of a .virgin file or something, and delete .virgin when you are done with the initial setup.

Another way would be to source a first-time startup shell script from within your shell's init script only if it exists. After it runs, it could delete itself.

Hope some of this will give you some useful ideas.
_________________
For every higher wall, there is a taller ladder
Back to top
View user's profile Send private message
Edgaer
Tux's lil' helper
Tux's lil' helper


Joined: 01 Jul 2002
Posts: 145
Location: The Isle of the Sundered

PostPosted: Thu Sep 05, 2002 3:22 am    Post subject: Reply with quote

Ok here's another question. How would I set it up so say a .emacs file exists but the set load path commands (for loading emacs modes for which there is no ebuild) points to /home/foo/path/here rather than ~/path/here
_________________
--First General Edgaer
Hope is the last to die. Unlike the icq flower.
Back to top
View user's profile Send private message
rac
Bodhisattva
Bodhisattva


Joined: 30 May 2002
Posts: 6553
Location: Japanifornia

PostPosted: Thu Sep 05, 2002 4:33 am    Post subject: Reply with quote

Past initial install, moving from Installing Gentoo to OTG. Edgaer, could you explain this in a little more detail? Shells usually expand ~ to your home directory, and I'm not exactly sure what you're asking.
_________________
For every higher wall, there is a taller ladder
Back to top
View user's profile Send private message
Edgaer
Tux's lil' helper
Tux's lil' helper


Joined: 01 Jul 2002
Posts: 145
Location: The Isle of the Sundered

PostPosted: Thu Sep 05, 2002 11:37 am    Post subject: Reply with quote

rac wrote:
Past initial install, moving from Installing Gentoo to OTG. Edgaer, could you explain this in a little more detail? Shells usually expand ~ to your home directory, and I'm not exactly sure what you're asking.


Well the .emacs file isn't a shell script but a lisp script. I'm not 100% certain it expands ~ but I could be wrong there. But then again I've never seen ~ used in any .emacs example files just full paths (eg. /home/foo/path/to/bar)
_________________
--First General Edgaer
Hope is the last to die. Unlike the icq flower.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum