12-19-2012
Oh OK, then you should try using launchd instead. But I'm not familiar with it.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am on AS3 Update 4 Linux
and am having an issue with an automated ftp script, I tried using the fd/sub proc method and that did not seem to work either. I normally use the following method to perform my ftp's but for some reason it works if I launch the script at the command line but in Cron it... (4 Replies)
Discussion started by: bryanthomas
4 Replies
2. UNIX for Dummies Questions & Answers
Hello
I need assistance with a bash script that needs to tell me whether in the last "x" days (which is a variable) anyone connected to the xxxx IP (which is another variable).
Thank you! (1 Reply)
Discussion started by: Melchiah
1 Replies
3. Solaris
I am having some issues with my cronjobs not running in solaris 10.
Cron is running:
~> ps -ef | grep cron
root 202 1 0 Jul 18 ? 0:01 /usr/sbin/cron
bender 1646 1562 0 01:57:49 syscon 0:00 grep cron
crontab -l lists the cronjob and I *think* its in the... (8 Replies)
Discussion started by: ippy98
8 Replies
4. Shell Programming and Scripting
Hi.
The below part of my bash script kicks out the following error message:
$ ./extract_eod_report_stats_new.sh 2010-04-23
./extract_eod_report_stats_new.sh: line 204: syntax error near unexpected token `('
./extract_eod_report_stats_new.sh: line 204: `TRANSACTIONS_RECEIVED_TOP=`grep... (6 Replies)
Discussion started by: Peter.Lovell
6 Replies
5. Shell Programming and Scripting
So what i am trying to do is write a script that takes in any number of scrambeled words and unscrambles them.
I have already addressed the issues of partial matches, exits silently if there are no matches, and finds words regardless of case that they were input. but while trying to get it so... (3 Replies)
Discussion started by: alindner
3 Replies
6. Shell Programming and Scripting
Hi, i want to rename a group of directories and files of my music, some items are like this:
- , for directories.
- , for files.
I want to do something like this:
, for directories.
, for files.
This is my code:
#!/bin/bash
for fname in *.mp3; do
echo item: $fname
mv... (2 Replies)
Discussion started by: josco1982
2 Replies
7. Shell Programming and Scripting
Hey guys,
I've registered here as I need urgent help. This is assignment for school and as you can see below I've completed the work. I'm simply stuck on one area.
:wall:
This script takes the first parameter (which is to be the new extension) and each parameter after that is a file... (1 Reply)
Discussion started by: Cynosure
1 Replies
8. UNIX for Advanced & Expert Users
Does the use of cron (HP-UX 11) present a security risk IF it is only given to accounts which have shell access anyway.
If it does present a risk, what is the risk?
Can a script (or command) run via cron; run anything, write anywhere or read anywhere that the same user can not do outside of... (2 Replies)
Discussion started by: eileenkeeney
2 Replies
9. Shell Programming and Scripting
Hi,
I'm having some trouble with using "case...esac" in Bash.
I've googled it and am stuggling to understand the syntax and how to do certain things.
Firstly, I want to be able to choose a case based on a variable number
For example, I have in my code a place where a user can enter... (2 Replies)
Discussion started by: Ste_Moore01
2 Replies
10. UNIX for Dummies Questions & Answers
Hi,
I have a very simple script that queries from a DB2 table. The script has 3 parts - (i) Sets the db2profile (ii) connects to db2 using credentials (iii) executes the query.This script works fine if i run it manually from the command prompt. However when scheduled in crontab, it proceeds... (2 Replies)
Discussion started by: VeePee
2 Replies
LEARN ABOUT MOJAVE
launch
launch(3) BSD Library Functions Manual launch(3)
NAME
launchd APIs -- interfaces for interacting with a launchd job.
SYNOPSIS
#include <launch.h>
#include <servers/bootstrap.h>
kern_return_t
bootstrap_check_in(mach_port_t bp, const name_t service_name, mach_port_t *sp);
int
launch_activate_socket(const char *name, int **fds, size_t *cnt);
DESCRIPTION
A launchd(8) job may have resources that are held on behalf of it while it is not running to facilitate launch-on-demand. These interfaces
allow for the job to retrieve these resources as part of its initialization.
Currently supported resource types are XPC listener connections, Mach ports, and sockets. Use of XPC with launchd(8) is documented in the
xpc(3) family of manual pages.
MACH PORTS
The bootstrap_check_in() routine allows for a launchd(8) job to retrieve the receive right to a Mach port that launchd(8) has created on
behalf of the job. launchd(8) creates this port and advertises it in the appropriate Mach bootstrap namespace by parsing the MachServices
entry of the job's launchd.plist(5). The first argument to bootstrap_check_in() should always be the bootstrap_port() global. The second
argument should be the name of the service whose port you wish to retrieve, as specified as an entry in the job's MachServices dictionary.
The final argument, upon successful return, will be the name of the receive right corresponding to the port that launchd(8) had advertised in
the bootstrap namespace.
If the job closes the receive right to the port with mach_port_mod_refs() or exits, the receive right obtained by this routine will be send
back to launchd(8) rather than being closed. This allows launchd to resume advertising the same port in the Mach bootstrap namespace and
frees clients from the need to re-query for the send right to that port when the job dies.
SOCKETS
The launch_activate_socket() routine allows a launchd(8) job to retrieve a set of file descriptors corresponding to a socket service that
launchd(8) has created and advertised on behalf of the job by parsing the Sockets entry in the job's launchd.plist(5). The first argument
should be the name of the socket entry as specified in the launchd.plist(5). The second argument, upon output, will point to an array of
integers whose count is filled into the third argument upon success. This array represents all the sockets that launchd(8) created corre-
sponding to the entry in the job's Sockets dictionary. Depending on the properties specified, a single Sockets entry may have multiple
descriptors created for it (one for IPv4 and one for IPv6, for example). This array is allocated on the heap, and it is the caller's respon-
sibility to call free(3) to dispose of the memory when it is no longer needed.
RETURN VALUES
If launch_activate_socket() succeeds, zero is returned. In the event of failure, a non-zero POSIX-compatible error code indicating the nature
of the error is returned. This error may be decoded with strerror(3).
If bootstrap_check_in() succeeds, KERN_SUCCESS is returned. In the event of failure, a non-zero error code that may be decoded with
bootstrap_strerror().
ERRORS
bootstrap_check_in() will fail if:
[BOOTSTRAP_UNKNOWN_SERVICE]
The Mach service name specified does not exist in the caller's launchd.plist(5).
[BOOTSTRAP_SERVICE_ACTIVE]
The specified Mach service has already been checked in by the job.
launch_activate_socket() will fail if:
[ENOENT] The socket name specified does not exist in the caller's launchd.plist(5).
[ESRCH] The calling process is not managed by launchd(8).
[EALREADY] The specified socket has already been activated.
SEE ALSO
xpc(3), xpc_connection_create(3), socket(2), launchd(8), launchd.plist(5).
Darwin 31 March, 2014 Darwin