Init: dependency based daemon starting?
note: I saw http://bbs.archlinux.org/viewtopic.php?id=69086, but i have no idea how the implementation is done (I don't understand Italian )
the current daemon backgrounding feature in rc.conf is pretty cool to save time, but:
1) you have no feedback if the daemon started successfully or not
2) due to its lack of finegrained-ness, the speed gains are limited.
for example, this is the DAEMONS array of my home server:
DAEMONS=(syslog-ng network @netfs @crond @sshd rpcbind nfs-common nfs-server openntpd @bitlbee @mediatomb @httpd @noip @dnsmasq)
The items at the right (bitlbee, mediatomb, ..) depend on nfs and ntp beind started completely, but ntpd should not have to wait until all the nfs stuff is started.
unfortunately, with the current "linear" syntax there is no way to improve this.
So if there was a way to express "daemon foo can start as soon as daemons (dependencies) bar and baz are started" we can optimize things a bit further.
then we could basically start everything backgrounded as soon as the dependencies are started.
As for problem 1: you could start each initscript in a seprate wrapper function or whatever, which buffers the stdout and stderr. If you start multiple daemons at the same time, scripts could leak output which may look garbled if you see multiple lines of text from different daemons at the same time. Once the script exited, you write the buffered stdout/stderr and put OK/WARNING thing on the right in place. maybe this is overkill though, most of the initscripts i use give no additional output anyway. But with this way, you could start multiple daemons at the same time in background, but still collect their return status and show it to the user.
Initing in this way can probably be done with a relatively small code increase, but would provide a slight performance improvement for some use cases.
Is it worth it? I don't know. Maybe there are even better initsystems which take it a few steps further, but i thought it was a cool idea
Well, you could always create a meta daemon (an init script in /etc/rc.d/ ) which starts a group of daemons.
It's been a while since I used initng as a lancher for archlinux initscript but it is certainly possible. I don't have the modified scripts anymore but it wasn't that hard to modify anyway.
As far as I know the finit-arc is based on fastinit (it doesn't have any dependency tracking):
http://helllabs.org/finit/
Last edited by PJ (2010-04-27 21:10:24)
Similar Messages
-
Hi ,
i need a query that will determine the weeks based on start date.
if the table consists of:
vDate vAmount
06/25/2007 100
06/27/2007 200
07/04/2007 400
If one enters start date as 6/25/2007 , amounts should be broken out in 7 day increments.
Result should be
week1 300
week2 400
where week1 should be from 6/25/2007 to 07/01/2007,
week2 should be from 07/02/2007 to 07/08/2007
and start date is not always on a Monday or Sunday...
any idea?
thanks in advancetry this...
SQL> with rt as
2 (select 'week'||(trunc(l/7,0)+1) wk_no,to_char(trunc(sysdate)+l,'dd-Mon-yyyy') dt,to_char(trunc(sysdate)+l,'Day') "Day" from
3 (select level-1 l from dual connect by level <= 367) where trunc(sysdate) between trunc(sysdate) and add_months(trunc(sysdate),12)),
4 xx as
5 (select '06/25/2007' vdate, 100 vamount from dual union all
6 select '06/27/2007', 200 from dual union all
7 select '07/04/2007', 400 from dual)
8 select wk_no,sum(vamount) from
9 (select (select wk_no from rt where dt = to_date(vdate,'MM/DD/YYYY')) wk_no,vamount from xx)
10 group by wk_no;
WK_NO SUM(VAMOUNT)
week1 300
week2 400
SQL>
SQL> select 'week'||(trunc(l/7,0)+1) wk_no,to_char(trunc(sysdate)+l,'dd-Mon-yyyy') dt,to_char(trunc(sysdate)+l,'Day') "Day" from
2 (select level-1 l from dual connect by level <= 367) where trunc(sysdate) between trunc(sysdate) and add_months(trunc(sysdate),12);
WK_NO DT Day
week1 25-Jun-2007 Monday
week1 26-Jun-2007 Tuesday
week1 27-Jun-2007 Wednesday
week1 28-Jun-2007 Thursday
week1 29-Jun-2007 Friday
week1 30-Jun-2007 Saturday
week1 01-Jul-2007 Sunday
week2 02-Jul-2007 Monday
week2 03-Jul-2007 Tuesday
week2 04-Jul-2007 Wednesday
week2 05-Jul-2007 Thursday
. -
Starting Oracle XE on linux by /etc/init.d/oracle-xe start
Hello,
I installed Oracle Database 10g Express Edition on a Linux Ubuntu 7.04 (feisty)
following official installation instructions found here
http://www.oracle.com/technology/software/products/database/xe/files/install.102/b25144/toc.htm#BABCEAHD
but I noticed a weird behavior.
The installation process was ok.
The configuration process (/etc/init.d/oracle-xe configure) was also ok.
I set everything on default except for the “starting on boot” option I choose NO, because the instructions let me understand that I can start the service manually by the command:
$ /etc/init.d/oracle-xe start
The configuration process at the end also started the service well, so I could test my new oracle installation on my web browser following the url http://127.0.0.1:8080/apex
Everything went fine... but...
On the next boot I wanted to start my oracle so I typed
sudo /etc/init.d/oracle-xe start
but nothing happened and the server didn't go up.
Looking into to script /etc/init.d/oracle-xe
we can find this switch
case "$1" in
start)
if test -f "$CONFIGURATION"
then
if test "$ORACLE_DBENABLED" != "true"
then
exit 0
fi
else
echo "Oracle Database 10g Express Edition is not configured. You must run
'/etc/init.d/oracle-xe configure' as the root user to configure the database."
exit 0
fi
start
this means that if you chose NO (N) for the “starting on boot” option on the configuration process (NB this choice put false in the env variable ORACLE_DBENABLED) you can't start the dbms by this script.
I try comment the few lines
then
#if test "$ORACLE_DBENABLED" != "true"
#then
# exit 0
#fi
else
and this time the server starts well.
So I deduced that something was wrong with the script and the official installation instructions.Yes... Thank you.
But I saw the problem could to be simple avoided using the options
enable/disable for the script /etc/init.d/oracle-xe,
If you choose not to start oracle at boot time, you can start it
manually by the sequence
/etc/init.d/oracle-xe enable
/etc/init.d/oracle-xe start
then when you want to stop it
/etc/init.d/oracle-xe stop
/etc/init.d/oracle-xe disable
by this last command we don't make oracle restart
at the next system boot.
I think it would be a good thing to update the reference
documentation at
http://www.oracle.com/technology/software/products/database/xe/files/install.102/b25144/toc.htm#BABCEAHD
to explain this situation better. -
Hyperion Planning dynamic forms based on start and end date across years
Hi All,
I have a requirement where i need to be able to view a form showing periods across years that are dynamically built depending on the start and end dates. If i have a start date of 01/11/2009 and an end date of 31/7/2013 i want to be able to view a form that shows all of the periods (Jan,Feb etc) in a form that is driven by these dates, in addition it will need to show the actual scenario up to the current month and the forecast from the current month to the end date. So basically if a user inputs the start and end dates the form will display the relevant periods driven by these dates.
Any tips very much appreciated!Hello,
This is difficult to realize, but you can get quite far with a workaround. The first question is, where do you want to input your selection of time periods? Assuming you have a webform with the complete timeline in months and years and you type in the start period and end period.
Webforms have the option to suppress rows and columns.
This can be extended with option of empty cells or not empty cells.
You will need to apply your creativity on this.
Put every month-year combination in a column and add the suppression.
Calculate the timeline between start period and end period with a dummy member, so data exists for these and columns will show.
Maybe you will need to copy the required timeline into a separate version for this, to avoid having periods which were outside the selection and still have data.
I hope these hints help a bit in this challenge.
Regards,
Philip Hulsebosch
www.trexco.nl -
Make daemons start after boot?
Can I make daemons start after the boot has ended? Netcfg uses about 10 seconds connecting to my wireless network, and the mounting of my windows share (trough fstab, using cifs) takes even longer. Therefore, I'd like to know if there's a way to start netcfg as a daemon and/or also mount my share after I've gotten into Arch and/or X after boot?
Can I use something like .xinitrc for this?
Last edited by Bennythen00b (2010-12-18 23:30:04)I tried that, but my windows share won't mount then for some reason. :-/
E: To be a little more specific, I backgrounded "net-profiles" and "network". I assume this doesn't work because whatever executes fstab tries to mount the share and fails before the network has finished connecting, or are daemons queued in the background too?
Anyway, just having "network" backgrounded works rather well, and I only have to wait for my wifi to connect. Not a huge problem, but I'd prefer having it start in the background in some way.
Last edited by Bennythen00b (2010-12-19 02:44:08) -
Help! How do I know the Oracle daemon started on Linux.
Dear Madem/Sir!
I had installed the Oracle 9.2 on the Red Hat Linux 8.0 platform.
But how do I know the Oracle Daemon started when the Linux startup?
Please help me to figure out it!
thanks and regards,
Janus
[email protected]A couple of ways, but easiest is to run the command "ps -ef" at a shell prompt. It will tell you which processes are running on your server. If oracle is running, you should see several oracle processes.
You may also try running "sqlplus" and see if it will let you connect to the database. Generally, if you try to run SQL*Plus and the database is not started, you will get an error message to that effect. -
Substring based on start and end characters
All
I want to perform susbstring of a string based on start character and end character
Please look at the below example:
str = "john$peter$rahul;
In this string i need to fetch charcters between $ i.e. defg
I cant use startindex and endindex as string may vary.
Can anybody help?praveen.kb wrote:
Thanks for the reply...
But i need string between 2 $ that is
peter only.. The string may contain any number of $.
This is the example:
str = "Prepared BY: $NAME$ ENTITY:$ENT$";I need only NAME and ENT. How can i do this?In your first example, you just wanted the middle word. Now you skip the String
"$ ENTITY:$"which is also between two $ signs.
You need to explain yourself a bit more. -
Hello everyone,
I know this is gonna sound a lil bit n00bish but then i'm a n00b.The problem is that "acpid" is starting twice while boot-up even though its enterd only once in /etc/rc.conf,i donno whats woring,is it whether the sequence in which ive put up the daemons or is it that some other program is starting it.Here's my daemon section of rc.conf file:-
# DAEMONS
# Daemons to start at boot-up (in this order)
# - prefix a daemon with a ! to disable it
# - prefix a daemon with a @ to start it up in the background
DAEMONS=(syslog-ng !hotplug !pcmcia network netfs crond dbus hal acpid gdm alsa)
Can anyone tell me whats going wrong?
Thanks in advance,
Rajiv Nairit just a guess, but: maybe a daemon u start "depends" on acpid and starts it with it (like portmap is started when u start fam).
just try putting acpid behind syslon-ng on 2nd place and see what u get
good luck,
cheers,
detto -
We have a business scenario where the receipt days for a location depends on the relationship between the Start-Destination Location. We need to include this constraint in an optimizer run with daily buckets.
Example:
Factory A (Start Location) ships to DC X (destination location) only on Mondays, with a lead time of 2 days. DC X should receive the stock from Factory A on Wednesday
Factory B (Start Location) ships to DC X (destination location) only on Thursdays, with a lead time of 1 day. DC X should receive the stock from Factory B on Saturday
Does anyone has been able to model this scenario?
I tried using transportation calendars(time stream) in the means of transport, having undesired results:
a) Transportation Lane A-X. Calendar 1A, only Monday is available
The system creates stock transfers on Monday on Week 1 and ends on Monday of Week 3.
b) Transportation Lane A-X. Calendar 2A, Monday and Wednesday are available
The system creates stock transfers on Monday and Wednesday on Week 1:
The stock transfer that starts on Monday-Week 1 ends on Monday-Week 2.
The stock transfer that starts on Wednesday-Week 1 ends on Wednesday-Week 2.
c) Transportation Lane A-X. Calendar 3A, Monday Tuesday and Wednesday are available
The system creates stock transfers on Monday, Tuesday and Wednesday on Week 1.
The stock transfer that starts on Monday-Week 1 ends on Wednesday-Week 1. (this is actually what I need)
The stock transfer that starts on Tuesday-Week 1 ends on Monday-Week 2.
The stock transfer that starts on Wednesday-Week 1 ends on Tuesday-Week 2.
Regardsyou really don't need to post all that code, few people will read it, or try to compile/run it.
just a tree in a scrollpane in a frame is all you need, then add the method/problem to the basic,
and post that so its only 20 to 30 lines long.
here's your basic tree/scrollpane/frame, with an expandAll()
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
class Testing
public void buildGUI()
JTree tree = new JTree();
expandAll(tree);
JFrame f = new JFrame();
f.getContentPane().add(new JScrollPane(tree));
f.pack();
f.setLocationRelativeTo(null);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setVisible(true);
public void expandAll(JTree tree)
int row = 0;
while (row < tree.getRowCount())
tree.expandRow(row);
row++;
public static void main(String[] args)
SwingUtilities.invokeLater(new Runnable(){
public void run(){
new Testing().buildGUI();
}so, is your problem with the expandAll(), or with reading the properties file? -
BAPI to create SNP planned order based on start date
Hi,
I am looking for a BAPI to create SNP planned order based on the order start date. There is BAPI BAPI_MOSRVAPS_CREATESNPORDER which can be used to create SNP planned order based on the end date but not based on the start date.
Also would be great if some one can share how do they create SNP Planned orders using BAPI BAPI_MOSRVAPS_CREATESNPORDER in case if GR processing time is defined in the product master and workdays for GR to be respected according to the calendar.
Regards,
VenkatHello Mr.Venkat,
Hope you recognize me.
Please check out the BAdi below.
BAdi - APO_BAPI_BUS10503 (this is the BAdi for ManufactOrderAPS BAPI which contains the SNPorder BAPI)
Method - CHANGE_SAVEMULTIPLE2
In this method parameter IT_ORDER_HEAD contains Order start date input option.
For GR time please check this (not sure if it will help).
Same BAdi/ same method
Parameter IV_PLANNING_MODE_USAGE contains field PLANNING_MODE.
Value 1 for PLANNING_MODE corresponds to "Observance of parameters from the product master".
This may make it respect the GR time in product master
Good luck with the above
Regards,
Ashok -
Contract Value Calulation based on Start & End Time
Hello Friends,
My client is into Vessel Hiring & the Vessels are given on hire for fixed period (with clear start & end dates & time).
For the above scenario we have a Periodic Contract to BIlling cycle which generates Invoices for every month. while creating the Contract we enter Basic Price as Day-Rate (Calculation type in Condition - O - Quantity - Daily Prices)
Thus the system automatically calculates the Basic Price Condition value based on number of days in any month.
Now the issue here is the client wants system to take Start & End time into consideration. In the Contract header - Contract Data tab we have developed two additional fields (Z-Fields) that capture start time & end time for every Contract.
So, we want system to calculate the Basic Price Condition value based on the Contract start date + Contract Start time.
Example :
1. Contract start date - 25.03.2010 & Start time = 12:00 noon. Basic Price = Rs. 10,000 per day.
2. In the Monthly Invoice, system would calcualte the Basic Price as Rs. 70,000 (7 days i.e. 25.03.2010 to 31.03.2010)
But here the client wants system to consider Start Time & determine Value as Rs. 65,000 as the Contract started on 12:00 noon on 25.03.2010.
Can anyone tell me how to achieve this?
I guess we should develop some routine (in VOFM) & apply it in Pricing Procedures.
But can some expert guide me on the logic of the routine & exactly where to apply the same in Pricing Procedure...
Thanks,
Jignesh MehtaHi,
Develop routine and make combination
if start date is xyz and start ime is less that 12 then price is so on so
if date start date is xyz and satrt time is more that 12 then price is so on so.
Hello I am not ABAPer, still tried to suggest you,don't mind for my suggestion
Kapil -
[SOLVED] Network daemon starting slowly
Hello guys,
It seems like the network daemon is starting rather slowly (maybe due to the fact that it has to obtain an ip address via dhcp). If I could get it to start faster, my system would boot up in under 10 seconds Is it safe to launch the network daemon in the background? If no, is there any way to speed it up?
Thanks for the help.
Last edited by 10098 (2010-05-16 12:35:54)Maybe try Backgrounding it by adding a @ in front of it within /etc/rc.conf.
Yes it's generally safe to background it in most cases unless you have a good reason not to do so.
Last edited by davidm (2010-05-13 16:40:37) -
ASM single instance + CRS daemons start problems Oracle10g rel3 and sun10
We have problems starting CRS by the ?/bin localconfig add/reset/all
We currently belive that sun10 has changed and Oracle10r3 do not cover the changes.
Need references where this work
SUN10, ASM on external (ASM on SAN), Oracle 10.2.03
We have installed oraclsw on 2 Oracle Homes (equal). One for asm and one for the databases and we try as root
sh -x $ORACLE_HOME/bin/localconfig reset $ORACLE_HOME
Giving up:Oracle CSS stack appears NOT to be running
ps -ef | grep css
root 20660 1 0 12:05.09 ? /bin/sh /etc/init.d/init.cssd run
ANY referenses ????
Best Regards
EivindWe have problems starting CRS by the ?/bin localconfig add/reset/all
We currently belive that sun10 has changed and Oracle10r3 do not cover the changes.
Need references where this work
SUN10, ASM on external (ASM on SAN), Oracle 10.2.03
We have installed oraclsw on 2 Oracle Homes (equal). One for asm and one for the databases and we try as root
sh -x $ORACLE_HOME/bin/localconfig reset $ORACLE_HOME
Giving up:Oracle CSS stack appears NOT to be running
ps -ef | grep css
root 20660 1 0 12:05.09 ? /bin/sh /etc/init.d/init.cssd run
ANY referenses ????
Best Regards
Eivind -
NetworkManager daemon starts then immediately kills itself
Hello,
I am running ArchLinux on a Thinkpad T60 and am trying to use NetworkManager to manage my wifi and ethernet. I have the drivers loaded for both as ifconfig -a shows them. I have installed NetworkManager from the kernel.org mirror as well as the GNOME applet for it. However when I attempt to start NetworkManager it with /etc/rc.d/networkmanager start it shows BUSY then DONE as if it is working. However the daemon does not live after that, it just kills itself with nothing left in the dmesg.log or daemon.log. I have all the default settings for this and have setup my /etc/hosts file correctly as well. Both Dbus and Hal are working fine as GNOME launches happily with everything running normally.
Would anyone have any idea why NetworkManager would be doing this?
Thanks in advanceAlso, (I wasn't clear from your post), did you add networkmanager to your daemon array in /etc/rc.conf? You should comment out network and add networkmanager like this DAEMONS=(!network networkmanager). And comment out #eth0="dhcp", and INTERFACES=(!eth0 !wlan0). Do a search for networkmanager on the wiki, there is a page devoted to it.
Last edited by stlarch (2011-02-18 16:51:50) -
Cron daemon start from command-line
Hello,
running WS 6.1 SP8, sometimes the cron daemon dies.
I want to restart the deamon with a script; is this possible?
I'm using "Cron based log rotation", not "Internal daemon log rotation"
My usage doesn't work, why ? The admin page in the GUI shows still OFF.
SERVER_ROOT=/opt/SUNWwbsvr
$SERVER_ROOT/bin/https/bin/schedulerd -d $SERVER_ROOT-- NickHave you checked "Using Schedulerd Control-based Log Rotation (UNIX/Linux)"
[http://docs.sun.com/app/docs/doc/820-1639/bhaeu?l=en&a=view|http://docs.sun.com/app/docs/doc/820-1639/bhaeu?l=en&a=view]
and
[http://www.sun.com/bigadmin/content/submitted/web_server_log.jsp|http://www.sun.com/bigadmin/content/submitted/web_server_log.jsp]
Maybe you are looking for
-
I want to ask something about firefox. why firefox use very much memory? can you develop to reduce memory comsume? this problem is very distrub in my PC with low memory. == This happened == Every time Firefox opened
-
How can i save multiple locations to my reminders app on the iphone 4?
I want to be reminded to do a task when I arrive home. Is it possible to save my home location (and other useful locations) to the reminders app? This is more useful than guessing when I will arrive at a location and setting a reminder for then. If n
-
Can I Replace my Early 2009 Mac Mini Hard Drive with my Early 2011 Macbook Pro Hard Drive?
I am replacing my 2011 Macbook Pro Hard Drive with a Solid State Drive. Instead of keeping the hard drive on an external enclosure I was wondering if I can use it to upgrade my Mac Mini's 160GB hard Drive with the one Im taking out of the MBP. And
-
Hi Guys, My environment is wl6.1sp2 and wli 2.1. I am trying to develop a bpm event plugin. I just copied the Event plugin files from the sample plugin and packaged them in my own package structure and am trying to deply this. I am not clear as to wh
-
Hola! I thrashed XP in favour of Win7, and everything works smoothly. There is just one thing that is bugging me: When I fire up my Lenovo (S10e) I get the XP loading bar, and not the Windows 7 "flying dots" comming together forming the windows logo.