Sponsored Content
Operating Systems OS X (Apple) How to execute a command when system boots? Post 302512376 by tlarkin on Saturday 9th of April 2011 07:53:59 PM
Old 04-09-2011
Quote:
Originally Posted by andrewust
I am the only user of this machine. So I guess I will choose (1).
Could you give me an example? I would like to create a ram disk when system starts up, so that I can use it as a temp folder. The command is:
diskutil erasevolume HFS+ 'ramdisk' `hdiutil attach -nomount ram://262144`

Thanks!
Launchd is a lot like cron, but more. You can Google for an app called Lingon, which will help you generate launchd items. You would just need to make a system deamon that runs your command and toss your plist file in /Library/LaunchdDaemons, then use launchctl to load it and you are set.

Here is an article explaining it

AFP548 - launchd in Depth
This User Gave Thanks to tlarkin For This Post:
 

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

AIX 433 boots into command line.

Hi All, I have an AIX 433 workstation that keeps booting into command mode. It was booting into CDE for a long time now. Suddenly now it boots into command line mode. No errors while booting up. Do not see anything in errpt. Don' t know where to start from.. Can any one please help me..thanks. ... (2 Replies)
Discussion started by: navinxavier
2 Replies

2. AIX

Execute a command at the system restart

Hi Folks, I have an AIX server and I would like the server to run the command saprouter -r at every system restarts. It needs to be run by a specific user. How would I do that? Thanks!!! (1 Reply)
Discussion started by: brookingsd
1 Replies

3. UNIX for Advanced & Expert Users

How to remotely execute a script (.COM ) on a VMS system ?

How to remotely execute a script (.COM ) on a VMS system ? rsh ? Thanks in advance (1 Reply)
Discussion started by: ivancleber
1 Replies

4. Programming

c++ : Use of System() to execute .exe with parameters

Hello, I 've trie to execute a a program with parameters unsuccessfully and i take the above message : "The system cannot find the path specified." I used a variaton of the above command : system("\"C:\\xxx\\xxx\\xxx.exe -xxx -xxx xxx.xxx xxx.xxx xxx.xxx\""); Thanks in advance (4 Replies)
Discussion started by: eusta
4 Replies

5. Shell Programming and Scripting

How to execute piped command using exec or system

Hi All, I want to execute a piped command like 'ls /opt | grep xml' using array as parameters list. How can I do that? (2 Replies)
Discussion started by: bharadiaam
2 Replies

6. Shell Programming and Scripting

Execute shell script in different system

Hi, I have a shell script in systemA and another shell script in systemB. when I execute the script in systemA, it should call the another script in systemB. Please tell me the way to do this. Thanks, Raja. (3 Replies)
Discussion started by: smr_rashmy
3 Replies

7. Ubuntu

execute command when Ubuntu boots up ?

hey all,, I want to add comments when Ubuntu starts up.. now I know that there is a directory called /etc/init.d which I can place my scripts there to run them at Ubuntu's startup.. but I prefer if there would be a file which runs when Ubuntu starts!! because it is only one command. not... (2 Replies)
Discussion started by: eawedat
2 Replies

8. Solaris

Solaris 10 system boots into Maintenance mode

I have seen similar threads on this issue, but I have not seen a fix. Basically I am getting a lot of rcp bind errors. Below find the output of "svcs -xv". not sure where to begin: # svcs -xv svc:/network/rpc/bind:default (RPC bindings) State: maintenance since Fri May 25 14:13:18 2012... (14 Replies)
Discussion started by: brownwrap
14 Replies

9. Red Hat

Systemd booting and execute system command is Not successful!help!

hi guys, booting centos7 and use systemd execute system command ulimit -SHn 202400 is fail.i dont know what's reason.can you give me help. ------------------------------------------ set-ulimit.service Description=test service After=systemd-update-utmp-runlevel.service #the last... (1 Reply)
Discussion started by: shean
1 Replies
AUTOMOUNTD(8)						    BSD System Manager's Manual 					     AUTOMOUNTD(8)

NAME
automountd -- automatic mount / unmount daemon for autofs SYNOPSIS
/usr/libexec/automountd [-v] [-n] [-T] [-o opts] [-D name=value] DESCRIPTION
automountd is a daemon that responds to requests from autofs to mount and unmount network filesystems, and to supply the contents of directo- ries, based on the contents of automounter maps. The automountd is started on demand by launchd(8). As the daemon is launched by launchd, the options below would be specified in the ProgramArguments key in the launchd plist for automountd. See FILES below. OPTIONS
-v Log to syslogd(8) more detailed information about actions taken by automountd. -n Disable browsing of all maps. -T Increase by 1 the logging level for messages printed to the standard output information about requests received from autofs, process- ing done for those requests, and replies sent to autofs. The default level of 0 causes no information to be logged; each higher value causes more information to be logged. -o opts Apply the options specified by opts to all mounts by default. The options for a particular mount can override these options. -D name=value Set the environment value specified by name to the specified value. Environment variables can be referred to in map entries; the value of the environment variable is substituted for the reference to the variable. FILES
/etc/autofs.conf configuration file used to manage automountd /System/Library/LaunchDaemons/com.apple.automountd.plist launchd plist SEE ALSO
auto_master(5), autofsd(8), automount(8), autofs.conf(5), mount(8), mount_nfs(8), launchd(8), launchd.plist(5) Darwin April 4, 2007 Darwin
All times are GMT -4. The time now is 04:31 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy