1. Beatrix Willius
  2. Valentina Server
  3. Saturday, March 28 2020, 09:56 AM
  4.  Subscribe via email
How do I use both Server.Restart and Server.Shutdown?

I'm testing those commands in the example ValentinaServerUtility. Both don't do anything. Using latest version of Valentina Server on High Sierra. The screenshot is from immediately after clicking the shutdown button. Restart also doesn't seem to do anything.
Comment
There are no comments made yet.
Beatrix Willius Accepted Answer
Screenshot was too large. Trying again.
Attachments (1)
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Server
  3. # 1
Ivan Smahin Accepted Answer
For Restart - you should see in the vServer log that all connections were dropped, vServer restarts every "internal" services and states. But it would not affect pref.panel, since there is no new log file, there is still the same vServer process ID and so on. In other words it restarts internally.

For Server.Shutdown - vServer process must be finished. But, look at

/Library/LaunchDaemons/com.paradigmasoft.vserver_x64.plist



...
<key>KeepAlive</key>
<true/>


It means new instance of vServer will be started if the vServer's process gone. You can not stop vServer without unloading this plist

Something like

launchctl bootout system /Library/LaunchDaemons/com.paradigmasoft.vserver_x64.plist


But you should see at least increased logs' count after Server.Shutdown
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Server
  3. # 2
Beatrix Willius Accepted Answer
Thanks for the information, Ivan.

Restart: yes, I can see the log files in Valentina Studio. The restart is done. However, when I try to change a server property then property isn't changed after the restart.

In the server utility:

- Click on Connect
- Change any property. For instance change the Max Client Timeout to 30. Click on the Set button.
- Click on Restart.
- Max Client Timeout is changed back to 20.

Is this the correct usage of restart?

- Shutdown: sorry, that isn't very useful. I know how to use the stop_me.sh script with launchctl unload.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Server
  3. # 3
Beatrix Willius Accepted Answer
@Francois Van Lerberghe: yes, my problems on macOS seem similar to yours. What use is a shutdown command if it doesn't do anything? What happens for you when you do the restart command on Windows? Are the properties saved?
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Server
  3. # 5
Beatrix Willius Accepted Answer
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Server
  3. # 6
mValentinaServer.SetVariable seems to be working well : the new value is stored in the ini file.

But the restart command freeze the server app (as explained in the bug report ID #8756 for the shutdown command).
As I can see in the log file, the server is trying to terminate endlessly but is failing so ("Terminating the connection : FAILED";) and the log file is rapidly growing...
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Server
  3. # 7
Beatrix Willius Accepted Answer
Interesting. That's not what I see. The variables aren't set. Which becomes evident when after restarting the old variable values are loaded.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Server
  3. # 8
On MacOS side (Mojave 10.14.6, Valentina 10.1), mValentinaServer.SetVariable (tried on MaxClientTimeout) is working well too (=correctly set as on Windows side). The ini file is changed.
The restart or shutdown command (mValentinaServer.Restart) is working well here on MacOS.
I can see it in the Log folder : a new log file is created each time. Secondly, I must allow the app in the firewall each time too (as, I think, my custom* Valentina server app is not signed).
Not tried with the pref pane.

*I've changed the app name, exe name (and the ini file name) and reflected in the plist file with a custom name.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Server
  3. # 9
Forget to say : ValentinaServerUtility complied with Xojo 2019r1.1
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Server
  3. # 10
Beatrix Willius Accepted Answer
Very odd. Why don't I see the same here? Need to test on my other computer with Catalina.

@Valentina folks: any information? I need to have a solution soon.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Server
  3. # 11
Some additional information about my installation on MacOS :
- My vServer folder is installed in the user Documents folder
- it as the following permissions : theUser RW, myCustomGroup RW, everyone no access
Every account allowed to access to the server is included in myCustomGroup
The INI file is created by me and has the same permissions (but if I let Valentina server create this ini file automatically, the results are the same : I can change the settings)


My server is launched by a plist file stored in /Library/LaunchDaemons/ (permissions are the same as the parent folder)
In this plist file, I've added
<key>GroupName</key>
<string>myCustomGroup</string>
<key>Umask</key>
<integer>7</integer>

In the INI file, have you the HOSTINGMODE = 0 ?
(if <> 0 then vServer properties are not changeable)
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Server
  3. # 12
Beatrix Willius Accepted Answer
That's not a typical installation of vServer.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Server
  3. # 13
Yes indeed.
I've done that in order to manage the backups myself (by the client app).
If the server is in a system owned folder (/Library/), I cannot use/create/delete other folders in the server folder via the client app as it don't have permissions to do so.
I want to make backup using the Valentina API (SQLExecute(BACKUP DATABASE)) and next move/copy to another location and manage older backup.

This configuration is working well, but I don't consider myself a server guru and perhaps I do that the wrong way.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Server
  3. # 14
Ivan Smahin Accepted Answer
Beatrix, it seems ValentinaServerUtility example is a bit "out of sync".

MAXCLIENTTIMEOUT is deprecated now, you should use MAXIDLECLIENTTIMEOUT variable instead.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Server
  3. # 15
Ivan Smahin Accepted Answer
Something like


SET PROPERTY MAXIDLECLIENTTIMEOUT OF SERVER to 30;
...
do restart
...
GET PROPERTY MAXIDLECLIENTTIMEOUT OF SERVER;
-- 30
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Server
  3. # 16
Ivan Smahin Accepted Answer
François, I saw you bug report about "vServer's restart in Windows". I will take a look there a bit later.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Server
  3. # 17
Ivan Smahin Accepted Answer
BTW,
As I can see in the log file, the server is trying to terminate endlessly but is failing so ("Terminating the connection : FAILED";) and the log file is rapidly growing...


Could you send me the vServer log? Please do it with VerbooseMode == 3.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Server
  3. # 18
Beatrix Willius Accepted Answer
Now using the latest version 10.1.2. I'm still working with the Valentina Server Utility.

I was successful when changing the cache size. MAXIDLECLIENTTIMEOUT still doesn't want to be changed.

Why do I get an error 394507 after changing properties and restarting?
Attachments (1)
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Server
  3. # 19
FYI, In my variation of ValentinaUtility,
1) in DoServerRestart, I do

mValentinaServer.Restart
DisconnectFromServer

2) in DisconnectFromServer, I
- reset properties
- close the connection
- start a Timer to wait 1 second letting the server to restart
If I don't wait, I'm raising sometime an error

mValentinaServer = nil
mVConnection.Close
mVConnection = nil
// Update UI
...
// Wait 1 second before manually reconnect
myTimerConnection.Mode = 1
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Server
  3. # 20
  • Page :
  • 1
  • 2


There are no replies made for this post yet.
However, you are not allowed to reply to this post.

Categories

Announcements & News
  1. 0 subcategories
Valentina Studio
  1. 2 subcategories
Valentina Server
  1. 4 subcategories
Valentina Database ADK
  1. 0 subcategories
Valentina Reports ADK
  1. 0 subcategories
Other Discussions
  1. 2 subcategories
BETA Testing
  1. 0 subcategories
Education & Research
  1. 0 subcategories