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
|