wong_powah.RemoveThis@yahoo.ca wrote:
> After my program (service) 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?
>
> 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
>
Your postinstall scriptlet needs to start your program; e.g.,
service myprog on
/dan