Re: [OpenIndiana-discuss] shell script mutex locking or process signaling
From: Laurent Blume [mailto:laurent...@elanor.org] That's why I pointed out mine are in /tmp or /var/run - tmpfs, so it's guaranteed cleared on reboot, graceful or not :-) The behavior of clearing out /tmp is a configurable feature, and the default varies by OS. Some OSes clear it on every reboot, some clear it according to an aging schedule, some don't clear it. I'm not sure what the default is for solaris / openindiana. For the problem at hand (SMF service) obviously, it doesn't matter what the linux defaults are. ;-) ___ OpenIndiana-discuss mailing list OpenIndiana-discuss@openindiana.org http://openindiana.org/mailman/listinfo/openindiana-discuss
[OpenIndiana-discuss] illumos install problem
Hello. I've just built illumos-gate in zone and now I'm trying to install it in the base system. However, pkg exits with error during update: # ./usr/src/tools/scripts/onu -t illumos-2013-05-30-patched -d /zones/build/root/export/home/build/srcs/illumos-gate/packages/i386/nightly/ Created successfully Mounted successfully on: '/tmp/onu.5yaiLU' Packages to remove: 1 Create boot environment: No Create backup boot environment: No PHASEACTIONS Removal Phase5/5 PHASE ITEMS Package State Update Phase 1/1 Package Cache Update Phase 1/1 Image State Update Phase 2/2 pkg: 2/3 catalogs successfully updated: file protocol error: code: 37 URL: 'file://zones/build/root/export/home/build/srcs/illumos-gate/packages/i386/nightly/repo.redist/catalog/catalog.attrs'. (happened 4 times) pkg -R /tmp/onu.5yaiLU refresh --full failed: exit code 3 What can be a reason for this and how can it be fixed? -- Best regards, Alexander Pyhalov, system administrator of Computer Center of Southern Federal University ___ OpenIndiana-discuss mailing list OpenIndiana-discuss@openindiana.org http://openindiana.org/mailman/listinfo/openindiana-discuss
Re: [OpenIndiana-discuss] shell script mutex locking or process signaling
From: Gary Mills [mailto:gary_mi...@fastmail.fm] SMF is actually well documented, but you do have to jump around from man page to man page. Start with `man smf'. There are also lots of examples to follow, both of manifests and methods. They are all text files. Ok, so here's a quasi-recent example of a difficulty I've encountered trying to use SMF. I have a service, which is configured for a single instance. I then wanted to break it into individual instances, svc:foo and svc:bar. I looked at examples, I did what I thought made sense, tried to import it, and SMF puked on the xml, saying something generic like invalid configuration. If SMF is actually well documented and good to work with, I need something to (a) guide me creating good xml, and (b) validate the xml, letting me know if something's wrong, and how to fix it. Last I knew, there are a bunch of good html editors out there. You start typing something, and based on context, the tool knows what's valid to use in the spot where you are working, so it will suggest and autocomplete tags, and properties inside of tags. If you start typing li when you're not inside ul or ol they throw warning signs at you. Last I knew, there isn't any such thing as a DTD aware XML editor. So when I sit down and start typing XML, I have no idea what tags belong in the place where I'm typing. In my example above, it turned out, I was putting the exec method before the dependency name, or something like that. Order matters in XML, and I got it wrong just by trying to read and copy some example into my service manifest. To debug, I forget the exact process I followed, but I recall it being painfully iterative and manual. I'd recommend using the facilities of SMF, rather than trying to do it all outside of SMF. These facilities are extensive and complete. You say SMF has capabilities that make this all go away. But I read man smf and I don't see it there. I don't know what to look for, and I'm not going to read the DTD from top to bottom, hoping to find something that fits the bill. Have you considered the contract facility? It's used internally by SMF, but you can use it elsewhere as well. The shell commands are ctrun(1), ctstat(1), ctwatch(1), and pkill(1). There may be a solution there, but I'm not very familiar with solaris contract subsystem - it looks like you define the behavior of one process, and you use another process to monitor it. If this is correct, it would make a very convoluted solution - A SMF service launches the start method, and while it's running, the same service launches the stop or refresh method ... Rather than executing the method directly, in each situation, utilizing contracts, the method would actually start a contract to monitor a sub-method for executing the start, stop, or refresh. And if the user (or system) is repeating calls to start/stop/refresh, each of these instances need to be made aware of each other, so the later method calls signal the earlier ones that they should terminate their contracts ... *blah* In any event, for the problem at hand in this thread, I used the easy solution: Script starts. Script uses mkdir $LOCKDIR which is /tmp/something Script chugs along, and at select moments, checks for the existence of $BREAKLOCKDIR, which is /tmp/somethingelse If a script starts and fails to get lock on LOCKDIR, then the script locks BREAKLOCKDIR and starts polling for the non-existence of LOCKDIR. LOCKDIR is a signal that a script is already running. BREAKLOCKDIR is a signal that a later process wants to steal lock. If LOCKDIR becomes stale (for example, system power cycled while lock existed) any script that *has* lock guarantees to release it in less than 60 seconds. So if the BREAKLOCK script detects LOCK exists for more than 60 seconds, assume it's a stale lock and steal it forcibly. ___ OpenIndiana-discuss mailing list OpenIndiana-discuss@openindiana.org http://openindiana.org/mailman/listinfo/openindiana-discuss
Re: [OpenIndiana-discuss] shell script mutex locking or process signaling
On 31/05/13 13:15, Edward Ned Harvey (openindiana) wrote: I'm not sure what the default is for solaris / openindiana. For the problem at hand (SMF service) obviously, it doesn't matter what the linux defaults are. ;-) Of course I assumed we were compliant with filesystem(4) here ;-) For what is worth, I can't stand /tmp not being cleaned up on reboot. What's the point of having /tmp and /var/tmp if they both behave the same? So tmpfs it is on my RHEL boxes too. But yes, I know the FHS has chosen to not be assertive on this, and distros have widely interpreted «it is recommended to clean it on boot» as a pass to keep it (and using instead funky workarounds to clean it up at varied times). So much for standardization. Anyway, out of this scope :-) Laurent ___ OpenIndiana-discuss mailing list OpenIndiana-discuss@openindiana.org http://openindiana.org/mailman/listinfo/openindiana-discuss
Re: [OpenIndiana-discuss] illumos install problem
On 05/31/2013 15:31, Alexander Pyhalov wrote: Hello. I've just built illumos-gate in zone and now I'm trying to install it in the base system. However, pkg exits with error during update: # ./usr/src/tools/scripts/onu -t illumos-2013-05-30-patched -d /zones/build/root/export/home/build/srcs/illumos-gate/packages/i386/nightly/ Created successfully Mounted successfully on: '/tmp/onu.5yaiLU' Packages to remove: 1 Create boot environment: No Create backup boot environment: No PHASEACTIONS Removal Phase5/5 PHASE ITEMS Package State Update Phase 1/1 Package Cache Update Phase 1/1 Image State Update Phase 2/2 pkg: 2/3 catalogs successfully updated: file protocol error: code: 37 URL: 'file://zones/build/root/export/home/build/srcs/illumos-gate/packages/i386/nightly/repo.redist/catalog/catalog.attrs'. (happened 4 times) pkg -R /tmp/onu.5yaiLU refresh --full failed: exit code 3 What can be a reason for this and how can it be fixed? truss shows open64(/build/root/export/home/build/srcs/illumos-gate/packages/i386/nightly/repo.redist/catalog/catalog.attrs, O_RDONLY) Err#2 ENOENT Why does pkg searches for data in /build/root, when it is said to look for in /zones/build/root? I've made symlink /build = /zones/build and this solved the problem, but why did it cut off the top directory in the path? -- Best regards, Alexander Pyhalov, system administrator of Computer Center of Southern Federal University ___ OpenIndiana-discuss mailing list OpenIndiana-discuss@openindiana.org http://openindiana.org/mailman/listinfo/openindiana-discuss
Re: [OpenIndiana-discuss] shell script mutex locking or process signaling
On 31/05/2013 13:41, Edward Ned Harvey (openindiana) wrote: From: Gary Mills [mailto:gary_mi...@fastmail.fm] SMF is actually well documented, but you do have to jump around from man page to man page. Start with `man smf'. There are also lots of examples to follow, both of manifests and methods. They are all text files. Ok, so here's a quasi-recent example of a difficulty I've encountered trying to use SMF. ... In my example above, it turned out, I was putting the exec method before the dependency name, or something like that. Order matters in XML, XML is as simple as it can get, because it's just a *grammar*. The hard part here is the *contents*, i.e, the SMF definitions. I'd recommend using the facilities of SMF, rather than trying to do it all outside of SMF. These facilities are extensive and complete. You say SMF has capabilities that make this all go away. But I read man smf and I don't see it there. If you don't understand SMF (which is a bit clumsy, but indeed has all what you want), use this little generator, it will do the hard work for you: http://sgpit.com/smf/ Hope that helps. ___ OpenIndiana-discuss mailing list OpenIndiana-discuss@openindiana.org http://openindiana.org/mailman/listinfo/openindiana-discuss
Re: [OpenIndiana-discuss] shell script mutex locking or process signaling
On 31/05/2013 16:44, Udo Grabowski (IMK) wrote: On 31/05/2013 13:41, Edward Ned Harvey (openindiana) wrote: From: Gary Mills [mailto:gary_mi...@fastmail.fm] SMF is actually well documented, but you do have to jump around from man page to man page. Start with `man smf'. There are also lots of examples to follow, both of manifests and methods. They are all text files. Ok, so here's a quasi-recent example of a difficulty I've encountered trying to use SMF. ... In my example above, it turned out, I was putting the exec method before the dependency name, or something like that. Order matters in XML, XML is as simple as it can get, because it's just a *grammar*. The hard part here is the *contents*, i.e, the SMF definitions. I'd recommend using the facilities of SMF, rather than trying to do it all outside of SMF. These facilities are extensive and complete. You say SMF has capabilities that make this all go away. But I read man smf and I don't see it there. If you don't understand SMF (which is a bit clumsy, but indeed has all what you want), use this little generator, it will do the hard work for you: http://sgpit.com/smf/ And here's another one for local use: http://code.google.com/p/manifold/ A description of some the possible tags: http://www.oracle.com/technetwork/server-storage/solaris/solaris-smf-manifest-wp-167902.pdf Oracle has svcbundle in Solaris 11.1: https://blogs.oracle.com/gman/entry/tt_svcbundle_tt_for_easier ___ OpenIndiana-discuss mailing list OpenIndiana-discuss@openindiana.org http://openindiana.org/mailman/listinfo/openindiana-discuss
Re: [OpenIndiana-discuss] shell script mutex locking or process signaling
From: Udo Grabowski (IMK) [mailto:udo.grabow...@kit.edu] If you don't understand SMF (which is a bit clumsy, but indeed has all what you want), use this little generator, it will do the hard work for you: http://sgpit.com/smf/ That's a pretty cool generator. But apparently, I understand SMF as well as it does. Because it allows you to specify start stop refresh methods ... But if those happen to take *time* to complete, and you start enabling/disabling/refreshing the service while the previous instances of enable/disable/refresh (start/stop/refresh) are still running, then multiple concurrent instances of those things get launched. Which is how I got where I am now. In any event, I went forward and implemented with mkdir locking. It works, and usually will, except in the event of ungraceful things. ___ OpenIndiana-discuss mailing list OpenIndiana-discuss@openindiana.org http://openindiana.org/mailman/listinfo/openindiana-discuss
[OpenIndiana-discuss] Adobe Flash crashes with Firefox 20 21 on OI_151a8
Hi all, I can't seem to be able to view YouTube videos on OI_151a8 using Firefox 20 or 21 and Adobe Flash 11.2. When I go to the page for a video, any video apparently, Firefox seems to load the page and then hangs for 20 seconds before reporting that the Flash plugin crashed. I have core dumps from the plugin-container process. My knowledge of mdb is very limited, but this is the kind of feedback I'm getting: ::status debugging core file of plugin-containe (32-bit) from Spook file: /export/home/ghost/Apps/firefox/plugin-container initial argv: /home/ghost/Apps/firefox/plugin-container /home/ghost/.mozilla/plugins/libflash threading model: native threads status: process terminated by SIGSEGV (Segmentation Fault), addr=14 ::stack 0xf8195dc2(efd06000, 280, b4, 280, 280, efd63010) 0xf81745e9(8046250, 280, b4, f6bceeb0, 280, 280) 0xf7e02645(f1197480, 8046250, 0, b4) 0xf7b7d181(f700b070, fed8, f6bcef88, f79aa20e) 0xf79aa236(f700b078, fe8c2000, 210, fed1e6e6) 0xf79aa290(f700b078, 62, 8, fed85840) 0xf79a9f50(f700b078, fed8, f6bcefe8, fed1f3ee) libc_hwcap1.so.1`_thrp_setup+0x9b(f9a92240) libc_hwcap1.so.1`_lwp_start(f9a92240, 0, 0, 0, 0, 0) If I try to walk the affected threads, I get this: 0xf8195dc2::walk thread | ::findstack stack pointer for thread 1: 8046198 [ 08046198 libc_hwcap1.so.1`yield+0x15() ] 080461e8 libc_hwcap1.so.1`cond_signal+0x18c() 08046208 0xf79aa372() 08046428 0xf7c94b77() 08046468 0xf7ab4d49() 080464f8 0xf7abef48() 080465a8 0xf7ac0f39() 08046688 0xf7de5132() 08046718 0xf7da51cf() 080467d8 0xf7da71db() 08046888 0xf79adbb1() 08046948 0xf79a125c() 08046968 libglib-2.0.so.0.2800.6`g_timeout_dispatch+0x20() 080469f8 libglib-2.0.so.0.2800.6`g_main_dispatch+0x1df() 08046a18 libglib-2.0.so.0.2800.6`g_main_context_dispatch+0x93() 08046a78 libglib-2.0.so.0.2800.6`g_main_context_iterate+0x3a8() 08046ab8 libglib-2.0.so.0.2800.6`g_main_context_iteration+0x7f() 08046b18 libxul.so`__1cEbaseQMessagePumpForUIRRunWithDispatcher6Mpn0ALMessagePumpIDelegate_p n0BKDispatcher__v_+0x6e() 08046b38 libxul.so`__1cEbaseQMessagePumpForUIDRun6Mpn0ALMessagePumpIDelegate__v_+0x17() 08046b68 libxul.so`__1cLMessageLoopDRun6M_v_+0x35() 08047818 libxul.so`XRE_InitChildProcess+0x3a7() 08047848 main+0x3e() 0804786c _start+0x7d() WAY MORE Now, what should I do? Does anyone want a copy of the core files so they can dissect them more accurately? Should I also post this to oi-dev? Bryan ___ OpenIndiana-discuss mailing list OpenIndiana-discuss@openindiana.org http://openindiana.org/mailman/listinfo/openindiana-discuss
Re: [OpenIndiana-discuss] shell script mutex locking or process signaling
On 05/31/13 12:36, Edward Ned Harvey (openindiana) wrote: From: Udo Grabowski (IMK) [mailto:udo.grabow...@kit.edu] If you don't understand SMF (which is a bit clumsy, but indeed has all what you want), use this little generator, it will do the hard work for you: http://sgpit.com/smf/ That's a pretty cool generator. But apparently, I understand SMF as well as it does. Because it allows you to specify start stop refresh methods ... But if those happen to take *time* to complete, and you start enabling/disabling/refreshing the service while the previous instances of enable/disable/refresh (start/stop/refresh) are still running, then multiple concurrent instances of those things get launched. Which is how I got where I am now. At least for me, when an SMF method takes time, I end up with that * marker in the svcs output, and it doesn't let me to do overlapping changes. Are your methods returning before the action they're supposed to take is completely finished? If so, then that sounds like the underlying problem to me. The methods are not supposed to exit until they're done doing whatever it is they do. If they do, then the design of that service is incomplete. -- James Carlson 42.703N 71.076W carls...@workingcode.com ___ OpenIndiana-discuss mailing list OpenIndiana-discuss@openindiana.org http://openindiana.org/mailman/listinfo/openindiana-discuss
Re: [OpenIndiana-discuss] Adobe Flash crashes with Firefox 20 21 on OI_151a8
ironsides.med...@gmail.com said: Unfortunately, rolling back to Firefox 17 ESR did not help. Same symptoms. YouTube was working fine before, on 151a7... That's why I posted the dumps, I thought maybe they would be helpful to the OI devs. I guess I can't roll back, as I have enabled the new compression feature flags on rpool. Anyway, I have been hoping for a while that flash player is finally laid to rest. For now I'll just use a VM when I need YouTube. If anyone else has any other ideas, I'll be glad to try them! There is a firefox add-on called shumway which can play some Flash stuff by converting it to HTML5 (or something like that). It works for me on oi151a7 for some Youtube videos, though not for all of them. Regards, Marion ___ OpenIndiana-discuss mailing list OpenIndiana-discuss@openindiana.org http://openindiana.org/mailman/listinfo/openindiana-discuss
[OpenIndiana-discuss] mysql-connector-java OI very slow
We brought our first OI server online a couple of days ago, and we've been having problems with our Java Swing database applications being very slow. That is, the queries that are hitting the mysql 5.1 server on the OI box are now very slow. This does not appear to be a problem with database applications that use other mysql drivers. We've been using mysql-connector-java-5.1.7-bin.jar with no problem, until we switched from an Ubuntu Linux box to this new OpenIndiana server. I'm in the process of trying other java drivers, but has anyone else run into this? And if so, how did you get it to work? We'd greatly appreciate any help you can give. fp ___ OpenIndiana-discuss mailing list OpenIndiana-discuss@openindiana.org http://openindiana.org/mailman/listinfo/openindiana-discuss
Re: [OpenIndiana-discuss] Adobe Flash crashes with Firefox 20 21 on OI_151a8
On 31/05/2013 20:33, Marion Hakanson wrote: ironsides.med...@gmail.com said: Unfortunately, rolling back to Firefox 17 ESR did not help. Same symptoms. YouTube was working fine before, on 151a7... That's why I posted the dumps, I thought maybe they would be helpful to the OI devs. I guess I can't roll back, as I have enabled the new compression feature flags on rpool. Anyway, I have been hoping for a while that flash player is finally laid to rest. For now I'll just use a VM when I need YouTube. If anyone else has any other ideas, I'll be glad to try them! There is a firefox add-on called shumway which can play some Flash stuff by converting it to HTML5 (or something like that). It works for me on oi151a7 for some Youtube videos, though not for all of them. You can also join the HTML 5 youtube trial (sets a cookie), but not all videos are shown with WebM, they fallback to flash if avalable: http://www.youtube.com/html5 ___ OpenIndiana-discuss mailing list OpenIndiana-discuss@openindiana.org http://openindiana.org/mailman/listinfo/openindiana-discuss
Re: [OpenIndiana-discuss] shell script mutex locking or process signaling
On 2013-05-31 13:41, Edward Ned Harvey (openindiana) wrote: If LOCKDIR becomes stale (for example, system power cycled while lock existed) any script that *has* lock guarantees to release it in less than 60 seconds. So if the BREAKLOCK script detects LOCK exists for more than 60 seconds, assume it's a stale lock and steal it forcibly. I've had my share of lock-files and lock-dirs to, usually, forbid simultaneous executions of a script (i.e. an initscript which can take quite a while for an appserver - don't let impatient admins on different consoles run it many times at once). Simply existence of an agreed-on filename is usually not enough. This file might hold a useful piece of information, such as the PID of the process which created it (echo $$ $LOCKFILE) so that other instances of the script can verify (with ps or /proc/$pid) that the locker indeed exists and works. Expectations that a job will take some predefined time usually become outdated (maybe in a year or two, especially for things like backup, scrub, appserver init - which may be proportional to amount of stored data) and regular jobs without such locks to abort concurrent new execution tend to pile up, slow the system down, take longer to execute, pile up more... you get the picture. It leads to exhaustion of resources and OOM kills on linux, or scanrate hell on Solaris... end of peaceful life one way or another :) Another thing to look out for is dependency on potentially slow resources, such as NFS which may be unavailable for a while and just blocks on access, depending on your setup. If you expect such troublemakers, wrap calls with a lifetime-limiting script (i.e. run for 60 seconds, then die ungracefully by external killer). HTH, //Jim ___ OpenIndiana-discuss mailing list OpenIndiana-discuss@openindiana.org http://openindiana.org/mailman/listinfo/openindiana-discuss
Re: [OpenIndiana-discuss] mysql-connector-java OI very slow
On May 31, 2013, at 1:23 PM, dormitionsk...@hotmail.com wrote: We brought our first OI server online a couple of days ago, and we've been having problems with our Java Swing database applications being very slow. That is, the queries that are hitting the mysql 5.1 server on the OI box are now very slow. This does not appear to be a problem with database applications that use other mysql drivers. We've been using mysql-connector-java-5.1.7-bin.jar with no problem, until we switched from an Ubuntu Linux box to this new OpenIndiana server. I'm in the process of trying other java drivers, but has anyone else run into this? And if so, how did you get it to work? We'd greatly appreciate any help you can give. fp ___ OpenIndiana-discuss mailing list OpenIndiana-discuss@openindiana.org http://openindiana.org/mailman/listinfo/openindiana-discuss Never mind. It wants persistent connections. I changed the code, rebuilt and deployed it, and now it works fine. Thank God!!! ___ OpenIndiana-discuss mailing list OpenIndiana-discuss@openindiana.org http://openindiana.org/mailman/listinfo/openindiana-discuss