Forum > General

Daemon in linux

<< < (2/3) > >>

motaz:
In Windows:

I installed it with Administrator, then it has been installed and appear in Services page, then I can start/stop it.
But it seems that it do nothing, I have added a text file log in Execute of TDaemon action, also in thread's Execute, TDaemon's Start action, but the text file is not created.

Also in Linux I use cleandirs --run, but also I get nothing.

Execute procedure which fail to write the text file:


--- Code: ---procedure TCleanDirsDaemon.CleanDirsDaemonExecute(Sender: TCustomDaemon);
var
  F: TextFile;
begin
  while status = csRunning do
  begin
    Sleep(1000);
    AssignFile(F, '/home/motaz/first.txt');
    if FileExists('/home/motaz/first.txt') then
      Append(F)
    else
      Rewrite(F);
    Writeln(F, DateTimeToStr(Now));
    CloseFile(F);
  end;
end;

--- End code ---

motaz:
Does anybody success on writing daemon in Linux using Lazarus?

fredycc:
Hi, I have the same problem with service I get nothing when the service start;  %). I try creating a text file, but nothis is created, I don't know why.

Lazarus 0.9.28.2 r22279 FPC 2.2.4 i386-win32-win32/win64
Windows 7 32 bits.

fredycc:
After try and try again, I can execute my own service into windows 7 Ultimate & Xp Sp3 without problems and the file attched is based in (daemon.pp) file, I modified some lines and now the service appear into the service manager after install and the service create a file into C:\temp, you can modify it, I used it that path for tests reasons.  ;)

Tomorrow I'll test it for ubuntu.

thierrybo:

--- Quote from: fredycc on May 05, 2010, 07:35:53 pm ---After try and try again, I can execute my own service into windows 7 Ultimate & Xp Sp3 without problems and the file attched is based in (daemon.pp) file, I modified some lines and now the service appear into the service manager after install and the service create a file into C:\temp, you can modify it, I used it that path for tests reasons.  ;)

Tomorrow I'll test it for ubuntu.

--- End quote ---

Hi,

I tried you attached project on Windows XP SP3. The service install fine, however there is an error when I want to start it (translated):


--- Quote ---Unable to start the daemon on Local Computer.
Error 3: The path specified is not found.
--- End quote ---

Any idea?

Sorry, I found. Project file was on a network drive  :)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version