LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > General
User Name
Password
General This forum is for non-technical general discussion which can include both Linux and non-Linux topics. Have fun!

Notices


Reply
  Search this Thread
Old 11-16-2007, 04:51 PM   #1
powah
Member
 
Registered: Mar 2005
Distribution: FC, Gentoo
Posts: 276

Rep: Reputation: 30
program does not work the first time, work only after restart


After my program (rpm) is installed and started on FC6, it does
not work the first time. After it is restarted, then it works.
How to fix this problem?

One idea is to restart the service after it is installed. Is it a good solution? If yes, how to implement it?

The spec file is like this:
...
%install
%define RPM_BUILD_DIR /usr/src/redhat/BUILD/%{name}-%{version}
rm -rf $RPM_BUILD_ROOT

mkdir -p $RPM_BUILD_ROOT/%{_prefix}/
mkdir -p $RPM_BUILD_ROOT/%{_bindirprefix}/
install $RPM_BUILD_DIR/%{name}-%{sourced_version}/myprog
$RPM_BUILD_ROOT/%{_prefix}/myprog
mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d
install $RPM_BUILD_DIR/%{name}-%{sourced_version}/myprog.init
$RPM_BUILD_ROOT/etc/rc.d/init.d/myprog

%post
chkconfig --add myprog
chkconfig --level 0123456 myprog on

%preun
chkconfig --del myprog
 
Old 11-18-2007, 12:52 PM   #2
mikemrh9
Member
 
Registered: Nov 2003
Distribution: Arch
Posts: 136

Rep: Reputation: 21
Try running ldconfig instead of rebooting. This will update the cache of library files, including any new ones that your program has just installed. Then, your program should be able to find all the bits that it needs to run.

If a reboot solved your problem, it's probably because ldconfig gets run as a part of the start-up process.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
sysklogd restart does not work in Debian 3.1 r2? rtmex Linux - Newbie 2 04-27-2007 05:54 PM
DRI Failing To Work After X-restart rakeyry Linux - General 1 12-31-2006 04:44 PM
apache2ctl restart doesn't work kwbolte Linux - Software 2 03-12-2006 04:49 PM
How come I have to restart my computer for network changes to work? lowpro2k3 Slackware 3 10-17-2005 10:33 AM
Keyboard doesn't work after RH restart win13 Linux - Hardware 0 01-07-2004 05:30 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > General

All times are GMT -5. The time now is 10:36 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration